No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
3 Posted Topics
Hi, I don't under what I'm doing wrong. In my line of code I have 2 outputs: The first outout returns a value, however, when I try to output the second ConsoleLine I get a value of "0"?? I'm thinking it has something to do with Converting a string to … | |
Hi , What do I need to modify in the "System.Text.RegularExpressions.Regex.Split(contents, "\\s+", RegexOptions.None);" so the string will also keep whitespaces? For example, in the .dat file you have: Hello Word Test1 Test2 Test3 If you noticed, I have whitespaces between each words, I want to keep that. so string[0] = … | |
Re: [QUOTE=_r0ckbaer;184177][code] StreamReader objInput = new StreamReader("C:\\values.dat", System.Text.Encoding.Default); string contents = objInput.ReadToEnd().Trim(); string [] split = System.Text.RegularExpressions.Regex.Split(contents, "\\s+", RegexOptions.None); foreach (string s in split) { Console.WriteLine(s); } [/code][/QUOTE] Hi _r0ckbaer, I don't know if you are still around... What do I need to modify in the "System.Text.RegularExpressions.Regex.Split(contents, "\\s+", RegexOptions.None);" so the … |
The End.