Indicates whether a Unicode character is categorized as white space.
Overloads IsWhiteSpace(Char)Indicates whether the specified Unicode character is categorized as white space.
IsWhiteSpace(String, Int32)Indicates whether the character at the specified position in a specified string is categorized as white space.
ExamplesThe following example demonstrates the IsWhiteSpace(Char) method.
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"
}
}
open System
let str = "black matter"
printfn $"{Char.IsWhiteSpace 'A'}" // Output: "False"
printfn $"{Char.IsWhiteSpace(str, 5)}" // Output: "True"
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
White space characters are the following Unicode characters:
Members of the UnicodeCategory.SpaceSeparator category, which includes the characters SPACE (U+0020), NO-BREAK SPACE (U+00A0), OGHAM SPACE MARK (U+1680), EN QUAD (U+2000), EM QUAD (U+2001), EN SPACE (U+2002), EM SPACE (U+2003), THREE-PER-EM SPACE (U+2004), FOUR-PER-EM SPACE (U+2005), SIX-PER-EM SPACE (U+2006), FIGURE SPACE (U+2007), PUNCTUATION SPACE (U+2008), THIN SPACE (U+2009), HAIR SPACE (U+200A), NARROW NO-BREAK SPACE (U+202F), MEDIUM MATHEMATICAL SPACE (U+205F), and IDEOGRAPHIC SPACE (U+3000).
Members of the UnicodeCategory.LineSeparator category, which consists solely of the LINE SEPARATOR character (U+2028).
Members of the UnicodeCategory.ParagraphSeparator category, which consists solely of the PARAGRAPH SEPARATOR character (U+2029).
The characters CHARACTER TABULATION (U+0009), LINE FEED (U+000A), LINE TABULATION (U+000B), FORM FEED (U+000C), CARRIAGE RETURN (U+000D), and NEXT LINE (U+0085).
Indicates whether the specified Unicode character is categorized as white space.
public:
static bool IsWhiteSpace(char c);
public static bool IsWhiteSpace(char c);
static member IsWhiteSpace : char -> bool
Public Shared Function IsWhiteSpace (c As Char) As Boolean
Parameters
The Unicode character to evaluate.
Returnstrue
if c
is white space; otherwise, false
.
White space characters are the following Unicode characters:
Members of the UnicodeCategory.SpaceSeparator category, which includes the characters SPACE (U+0020), NO-BREAK SPACE (U+00A0), OGHAM SPACE MARK (U+1680), EN QUAD (U+2000), EM QUAD (U+2001), EN SPACE (U+2002), EM SPACE (U+2003), THREE-PER-EM SPACE (U+2004), FOUR-PER-EM SPACE (U+2005), SIX-PER-EM SPACE (U+2006), FIGURE SPACE (U+2007), PUNCTUATION SPACE (U+2008), THIN SPACE (U+2009), HAIR SPACE (U+200A), NARROW NO-BREAK SPACE (U+202F), MEDIUM MATHEMATICAL SPACE (U+205F), and IDEOGRAPHIC SPACE (U+3000).
Members of the UnicodeCategory.LineSeparator category, which consists solely of the LINE SEPARATOR character (U+2028).
Members of the UnicodeCategory.ParagraphSeparator category, which consists solely of the PARAGRAPH SEPARATOR character (U+2029).
The characters CHARACTER TABULATION (U+0009), LINE FEED (U+000A), LINE TABULATION (U+000B), FORM FEED (U+000C), CARRIAGE RETURN (U+000D), and NEXT LINE (U+0085).
Indicates whether the character at the specified position in a specified string is categorized as white space.
public:
static bool IsWhiteSpace(System::String ^ s, int index);
public static bool IsWhiteSpace(string s, int index);
static member IsWhiteSpace : string * int -> bool
Public Shared Function IsWhiteSpace (s As String, index As Integer) As Boolean
Parameters
The position of the character to evaluate in s
.
true
if the character at position index
in s
is white space; otherwise, false
.
index
is less than zero or greater than the last position in s
.
Character positions in a string are indexed starting from zero.
White space characters are the following Unicode characters:
Members of the UnicodeCategory.SpaceSeparator category, which includes the characters SPACE (U+0020), NO-BREAK SPACE (U+00A0), OGHAM SPACE MARK (U+1680), EN QUAD (U+2000), EM QUAD (U+2001), EN SPACE (U+2002), EM SPACE (U+2003), THREE-PER-EM SPACE (U+2004), FOUR-PER-EM SPACE (U+2005), SIX-PER-EM SPACE (U+2006), FIGURE SPACE (U+2007), PUNCTUATION SPACE (U+2008), THIN SPACE (U+2009), HAIR SPACE (U+200A), NARROW NO-BREAK SPACE (U+202F), MEDIUM MATHEMATICAL SPACE (U+205F), and IDEOGRAPHIC SPACE (U+3000).
Members of the UnicodeCategory.LineSeparator category, which consists solely of the LINE SEPARATOR character (U+2028).
Members of the UnicodeCategory.ParagraphSeparator category, which consists solely of the PARAGRAPH SEPARATOR character (U+2029).
The characters CHARACTER TABULATION (U+0009), LINE FEED (U+000A), LINE TABULATION (U+000B), FORM FEED (U+000C), CARRIAGE RETURN (U+000D), and NEXT LINE (U+0085).
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4