Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //works
- int index = richTextBox1.Text.IndexOf(' ', 0);
- int index = richTextBox1.Text.IndexOf('n', 0);
- //doesn't work
- int index = richTextBox1.Text.IndexOf('\s', 0);
- int index = richTextBox1.Text.IndexOf("\s", 0);
- public static void Main()
- {
- var wsChars = Enumerable.Range(0, ushort.MaxValue)
- .Where(c => char.IsWhiteSpace(Convert.ToChar(c)))
- .Select(c => Convert.ToChar(c)).ToArray();
- Console.WriteLine(wsChars.Length);
- var someText = "This_is_atstring with nsome whitespace characters.";
- Console.WriteLine(someText.IndexOfAny(wsChars));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement