C# Char IsPunctuation(Char)
Description
Char IsPunctuation(Char)
indicates whether the specified
Unicode character is categorized as a punctuation mark.
Syntax
Char.IsPunctuation(Char)
has the following syntax.
public static bool IsPunctuation(
char c
)
Parameters
Char.IsPunctuation(Char)
has the following parameters.
c
- The Unicode character to evaluate.
Returns
Char.IsPunctuation(Char)
method returns true if c is a punctuation mark; otherwise, false.
Example
The following code example demonstrates IsPunctuation.
//from w ww . ja va2s . c o m
using System;
public class MainClass {
public static void Main() {
char ch = '.';
Console.WriteLine(Char.IsPunctuation(ch)); // Output: "True"
}
}
The code above generates the following result.