This documentation is archived and is not being maintained.

Char.IsSeparator Method

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

Overload List

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

[Visual Basic] Overloads Public Shared Function IsSeparator(Char) As Boolean
[C#] public static bool IsSeparator(char);
[C++] public: static bool IsSeparator(__wchar_t);
[JScript] public static function IsSeparator(Char) : Boolean;

Indicates whether the character at the specified position in a specified string is categorized as a separator character.

[Visual Basic] Overloads Public Shared Function IsSeparator(String, Integer) As Boolean
[C#] public static bool IsSeparator(string, int);
[C++] public: static bool IsSeparator(String*, int);
[JScript] public static function IsSeparator(String, int) : Boolean;

Example

[Visual Basic, C#, C++] The following sample demonstrates IsSeparator.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of IsSeparator. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Imports System

Module IsSeparatorSample

    Sub Main()

        Dim str As String
        str = "twain1 twain2"

        Console.WriteLine(Char.IsSeparator("a"c))       ' Output: "False"
        Console.WriteLine(Char.IsSeparator(str, 6))     ' Output: "True"

    End Sub

End Module

[C#] 
using System;

public class IsSeparatorSample {
    public static void Main() {
        string str = "twain1 twain2";

        Console.WriteLine(Char.IsSeparator('a'));        // Output: "False"
        Console.WriteLine(Char.IsSeparator(str, 6));    // Output: "True"
    }
}

[C++] 
#using <mscorlib.dll>
using namespace System;

int main() {
   String* str = "twain1 twain2";

   Console::WriteLine(Char::IsSeparator('a'));      // Output: "False"
   Console::WriteLine(Char::IsSeparator(str, 6));   // Output: "True"
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Char Structure | Char Members | System Namespace

Show: