Char::IsSeparator Method (Char)
Indicates whether the specified Unicode character is categorized as a separator character.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- c
- Type: System::Char
The Unicode character to evaluate.
The Unicode standard recognizes three subcategories of separators:
Space separators (the UnicodeCategory::SpaceSeparator category), which includes characters such as \u0020.
Line separators (the UnicodeCategory::LineSeparator category), which includes \u2028.
Paragraph separators (the UnicodeCategory::ParagraphSeparator category), which includes \u2029.
Note |
|---|
The Unicode standard classifies the characters \u000A (LF), \u000C (FF), and \u000A (CR) as control characters (members of the UnicodeCategory::Control category), not as separator characters. |
The following example lists the Char objects that are classified as separator characters.
using namespace System; int main(array<System::String ^> ^args) { for (int ctr = Convert::ToInt32(Char::MinValue); ctr <= Convert::ToInt32(Char::MaxValue); ctr++) { wchar_t ch = ctr; if (Char::IsSeparator(ch)) Console::WriteLine("\u{0:X4} ({1})", (int) ch, Char::GetUnicodeCategory(ch).ToString()); } Console::ReadLine(); } // The example displays the following output: // 0020 (SpaceSeparator) // u00A0 (SpaceSeparator) // u1680 (SpaceSeparator) // u180E (SpaceSeparator) // u2000 (SpaceSeparator) // u2001 (SpaceSeparator) // u2002 (SpaceSeparator) // u2003 (SpaceSeparator) // u2004 (SpaceSeparator) // u2005 (SpaceSeparator) // u2006 (SpaceSeparator) // u2007 (SpaceSeparator) // u2008 (SpaceSeparator) // u2009 (SpaceSeparator) // u200A (SpaceSeparator) // u2028 (LineSeparator) // u2029 (ParagraphSeparator) // u202F (SpaceSeparator) // u205F (SpaceSeparator) // u3000 (SpaceSeparator)
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note