C# Char IsWhiteSpace(String, Int32)
Description
Char IsWhiteSpace(String, Int32)
indicates whether
the character at the specified position in a specified string is categorized
as white space.
Syntax
Char.IsWhiteSpace(String, Int32)
has the following syntax.
public static bool IsWhiteSpace(
string s,
int index
)
Parameters
Char.IsWhiteSpace(String, Int32)
has the following parameters.
s
- A string.index
- The position of the character to evaluate in s.
Returns
Char.IsWhiteSpace(String, Int32)
method returns true if the character at position index in s is white space; otherwise, false.
Example
The following code example demonstrates IsWhiteSpace.
/*from www .j a v a2 s .c om*/
using System;
public class IsWhiteSpaceSample {
public static void Main() {
string str = "black red";
Console.WriteLine(Char.IsWhiteSpace(str, 5));
}
}
The code above generates the following result.