C# Char IsSeparator(Char)

Description

Char IsSeparator(Char) indicates whether the specified Unicode character is categorized as a separator character.

Syntax

Char.IsSeparator(Char) has the following syntax.


public static bool IsSeparator(
  char c
)

Parameters

Char.IsSeparator(Char) has the following parameters.

  • c - The Unicode character to evaluate.

Returns

Char.IsSeparator(Char) method returns true if c is a separator character; otherwise, false.

Example

The following example lists the Char objects that are classified as separator characters.


/*  w w w .j  av a 2  s  .  c o  m*/
using System;

public class Class1
{
   public static void Main()
   {
      for (int ctr = Convert.ToInt32(Char.MinValue); ctr <= Convert.ToInt32(Char.MaxValue); ctr++)
      {
         char ch = (Char) ctr;
         if (Char.IsSeparator(ch))
            Console.WriteLine(@"\u{0:X4} ({1})", (int) ch, Char.GetUnicodeCategory(ch).ToString());
      }
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version