This documentation is archived and is not being maintained.

Char.IsWhiteSpace Method

Indicates whether a Unicode character is categorized as white space.

Overload List

Indicates whether the specified Unicode character is categorized as white space.

Supported by the .NET Compact Framework.

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

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

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


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

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

Module IsWhiteSpaceSample

    Sub Main()

        Dim str As String
        str = "black matter"

        Console.WriteLine(Char.IsWhiteSpace("A"c))      ' Output: "False"
        Console.WriteLine(Char.IsWhiteSpace(str, 5))    ' Output: "True"

    End Sub

End Module

using System;

public class IsWhiteSpaceSample {
    public static void Main() {
        string str = "black matter"; 

        Console.WriteLine(Char.IsWhiteSpace('A'));        // Output: "False"
        Console.WriteLine(Char.IsWhiteSpace(str, 5));    // Output: "True"

#using <mscorlib.dll>
using namespace System;

int main() {
   String* str = "black matter"; 

   Console::WriteLine(Char::IsWhiteSpace('A'));     // Output: "False"
   Console::WriteLine(Char::IsWhiteSpace(str, 5));  // 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