A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.char.ispunctuation below:

Char.IsPunctuation Method (System) | Microsoft Learn

Char.IsPunctuation Method Definition

Indicates whether a Unicode character is categorized as a punctuation mark.

Overloads IsPunctuation(Char)

Indicates whether the specified Unicode character is categorized as a punctuation mark.

IsPunctuation(String, Int32)

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

Examples

The following code example demonstrates IsPunctuation.

using System;

public class IsPunctuationSample {
    public static void Main() {
        char ch = '.';

        Console.WriteLine(Char.IsPunctuation(ch));						// Output: "True"
        Console.WriteLine(Char.IsPunctuation("no punctuation", 3));		// Output: "False"
    }
}
open System

let ch = '.'

printfn $"{Char.IsPunctuation ch}"                       // Output: "True"
printfn $"""{Char.IsPunctuation("no punctuation", 3)}""" // Output: "False"
Module IsPunctuationSample

    Sub Main()

        Dim ch As Char
        ch = "."c

        Console.WriteLine(Char.IsPunctuation(ch))                   ' Output: "True"
        Console.WriteLine(Char.IsPunctuation("no punctuation", 3))  ' Output: "False"

    End Sub

End Module

Valid punctuation marks are members of the following categories in UnicodeCategory: ConnectorPunctuation, DashPunctuation, OpenPunctuation, ClosePunctuation, InitialQuotePunctuation, FinalQuotePunctuation, or OtherPunctuation. They include characters with the following Unicode code points:

IsPunctuation(Char)
Source:
Char.cs
Source:
Char.cs
Source:
Char.cs
Source:
Char.cs

Indicates whether the specified Unicode character is categorized as a punctuation mark.

public:
 static bool IsPunctuation(char c);
public static bool IsPunctuation(char c);
static member IsPunctuation : char -> bool
Public Shared Function IsPunctuation (c As Char) As Boolean
Parameters
c
Char

The Unicode character to evaluate.

Returns

true if c is a punctuation mark; otherwise, false.

Remarks

Valid punctuation marks are members of the following categories in UnicodeCategory: ConnectorPunctuation, DashPunctuation, OpenPunctuation, ClosePunctuation, InitialQuotePunctuation, FinalQuotePunctuation, or OtherPunctuation. They include characters with the following Unicode code points:

See also IsPunctuation(String, Int32)
Source:
Char.cs
Source:
Char.cs
Source:
Char.cs
Source:
Char.cs

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

public:
 static bool IsPunctuation(System::String ^ s, int index);
public static bool IsPunctuation(string s, int index);
static member IsPunctuation : string * int -> bool
Public Shared Function IsPunctuation (s As String, index As Integer) As Boolean
Parameters
index
Int32

The position of the character to evaluate in s.

Returns

true if the character at position index in s is a punctuation mark; otherwise, false.

Exceptions

index is less than zero or greater than the last position in s.

Remarks

Character positions in a string are indexed starting from zero.

Valid punctuation marks are members of the following categories in UnicodeCategory: ConnectorPunctuation, DashPunctuation, OpenPunctuation, ClosePunctuation, InitialQuotePunctuation, FinalQuotePunctuation, or OtherPunctuation. They include characters with the following Unicode code points:

See also

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 article

Was 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