Export (0) Print
Expand All

Char.IsSeparator Method (Char)

Indicates whether the specified Unicode character is categorized as a separator character.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Function IsSeparator ( _
	c As Char _
) As Boolean

Parameters

c
Type: System.Char

The Unicode character to evaluate.

Return Value

Type: System.Boolean
true if c is a separator character; otherwise, false.

The Unicode standard recognizes three subcategories of separators:

NoteNote

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.

Module Example
   Public Sub Main()
      For ctr As Integer = Convert.ToInt32(Char.MinValue) To Convert.ToInt32(Char.MaxValue)
         Dim ch As Char = ChrW(ctr)
         If Char.IsSeparator(ch) Then
            Console.WriteLine("\u{0:X4} ({1})", AscW(ch), Char.GetUnicodeCategory(ch).ToString())
         End If 
      Next 
   End Sub 
End Module 
' The example displays the following output: 
'       \u0020 (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)

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft