Check if a character is a Separator in CSharp
Description
The following code shows how to check if a character is a Separator.
Example
/*from ww w.j a v a2s . c om*/
using System;
class MainClass {
public static void Main() {
string str = "This is a test. $23";
int i;
for(i=0; i < str.Length; i++) {
Console.Write(str[i] + " is");
if(Char.IsSeparator(str[i]))
Console.Write(" separator");
Console.WriteLine();
}
}
}
The code above generates the following result.