Char.IsPunctuation Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Anger om ett Unicode-tecken kategoriseras som ett skiljetecken.
Överlagringar
| Name | Description |
|---|---|
| IsPunctuation(Char) |
Anger om det angivna Unicode-tecknet kategoriseras som ett skiljetecken. |
| IsPunctuation(String, Int32) |
Anger om tecknet på den angivna positionen i en angiven sträng kategoriseras som ett skiljetecken. |
Exempel
Följande kodexempel visar 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
Kommentarer
Giltiga skiljetecken är medlemmar i följande kategorier i : , , , , ClosePunctuation, InitialQuotePunctuation, FinalQuotePunctuationeller OtherPunctuation. OpenPunctuationDashPunctuationConnectorPunctuationUnicodeCategory De innehåller tecken med följande Unicode-kodpunkter:
- U+0021 till U+0023
- U+060C och U+060D
- U+1800 till U+180A
- U+3014 till U+301F
- U+0025 till U+002A
- U+061B
- U+1944 och U+1945
- U+3030
- U+002C till U+002F
- U+061E och U+061F
- U+19DE och U+19DF
- U+303D
- U+003A och U+003B
- U+066A till U+066D
- U+1A1E och U+1A1F
- U+30A0
- U+003F och U+0040
- U+06D4
- U+1B5A till U+1B60
- U+30FB
- U+005B till U+005D
- U+0700 till U+070D
- U+2010 till U+2027
- U+A874 till U+A877
- U+005F
- U+07F7 till U+07F9
- U+2030 till U+2043
- U+FD3E och U+FD3F
- U+007B
- U+0964 och U+0965
- U+2045 till U+2051
- U+FE10 till U+FE19
- U+007D
- U+0970
- U+2053 till U+205E
- U+FE30 till U+FE52
- U+00A1
- U+0DF4
- U+207D och U+207E
- U+FE54 till U+FE61
- U+00AB
- U+0E4F till U+0E5B
- U+208D och U+208E
- U+FE63
- U+00AD
- U+0F04 till U+0F12
- U+2329 och U+232A
- U+FE68
- U+00B7
- U+0F3A till U+0F3D
- U+2768 till U+2775
- U+FE6A och U+FE6B
- U+00BB
- U+0F85
- U+27C5 till U+27C6
- U+FF01 till U+FF03
- U+00BF
- U+0FD0 och U+0FD1
- U+27E6 till U+27EB
- U+FF05 till U+FF0A
- U+037E
- U+104A till U+104F
- U+2983 till U+2998
- U+FF0C till U+FF0F
- U+0387
- U+10FB
- U+29D8 till U+29DB
- U+FF1A och U+FF1B
- U+055A till U+055F
- U+1361 till U+1368
- U+29FC och U+29FD
- U+FF1F och U+FF20
- U+0589 och U+058A
- U+166D och U+166E
- U+2CF9 till U+2CFC
- U+FF3B till U+FF3D
- U+05BE
- U+169B och U+169C
- U+2CFE och U+2CFF
- U+FF3F
- U+05C0
- U+16EB till U+16ED
- U+2E00 till U+2E17
- U+FF5B
- U+05C3
- U+1735 och U+1736
- U+2E1C och U+2E1D
- U+FF5D
- U+05C6
- U+17D4 till U+17D6
- U+3001 till U+3003
- U+FF5F till U+FF65
- U+05F3 och U+05F4
- U+17D8 till U+17DA
- U+3008 till U+3011
IsPunctuation(Char)
Anger om det angivna Unicode-tecknet kategoriseras som ett skiljetecken.
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
Parametrar
- c
- Char
Unicode-tecknet som ska utvärderas.
Returer
trueom c är ett skiljetecken, annars . false
Kommentarer
Giltiga skiljetecken är medlemmar i följande kategorier i : , , , , ClosePunctuation, InitialQuotePunctuation, FinalQuotePunctuationeller OtherPunctuation. OpenPunctuationDashPunctuationConnectorPunctuationUnicodeCategory De innehåller tecken med följande Unicode-kodpunkter:
- U+0021 till U+0023
- U+060C och U+060D
- U+1800 till U+180A
- U+3014 till U+301F
- U+0025 till U+002A
- U+061B
- U+1944 och U+1945
- U+3030
- U+002C till U+002F
- U+061E och U+061F
- U+19DE och U+19DF
- U+303D
- U+003A och U+003B
- U+066A till U+066D
- U+1A1E och U+1A1F
- U+30A0
- U+003F och U+0040
- U+06D4
- U+1B5A till U+1B60
- U+30FB
- U+005B till U+005D
- U+0700 till U+070D
- U+2010 till U+2027
- U+A874 till U+A877
- U+005F
- U+07F7 till U+07F9
- U+2030 till U+2043
- U+FD3E och U+FD3F
- U+007B
- U+0964 och U+0965
- U+2045 till U+2051
- U+FE10 till U+FE19
- U+007D
- U+0970
- U+2053 till U+205E
- U+FE30 till U+FE52
- U+00A1
- U+0DF4
- U+207D och U+207E
- U+FE54 till U+FE61
- U+00AB
- U+0E4F till U+0E5B
- U+208D och U+208E
- U+FE63
- U+00AD
- U+0F04 till U+0F12
- U+2329 och U+232A
- U+FE68
- U+00B7
- U+0F3A till U+0F3D
- U+2768 till U+2775
- U+FE6A och U+FE6B
- U+00BB
- U+0F85
- U+27C5 till U+27C6
- U+FF01 till U+FF03
- U+00BF
- U+0FD0 och U+0FD1
- U+27E6 till U+27EB
- U+FF05 till U+FF0A
- U+037E
- U+104A till U+104F
- U+2983 till U+2998
- U+FF0C till U+FF0F
- U+0387
- U+10FB
- U+29D8 till U+29DB
- U+FF1A och U+FF1B
- U+055A till U+055F
- U+1361 till U+1368
- U+29FC och U+29FD
- U+FF1F och U+FF20
- U+0589 och U+058A
- U+166D och U+166E
- U+2CF9 till U+2CFC
- U+FF3B till U+FF3D
- U+05BE
- U+169B och U+169C
- U+2CFE och U+2CFF
- U+FF3F
- U+05C0
- U+16EB till U+16ED
- U+2E00 till U+2E17
- U+FF5B
- U+05C3
- U+1735 och U+1736
- U+2E1C och U+2E1D
- U+FF5D
- U+05C6
- U+17D4 till U+17D6
- U+3001 till U+3003
- U+FF5F till U+FF65
- U+05F3 och U+05F4
- U+17D8 till U+17DA
- U+3008 till U+3011
Se även
Gäller för
IsPunctuation(String, Int32)
Anger om tecknet på den angivna positionen i en angiven sträng kategoriseras som ett skiljetecken.
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
Parametrar
- s
- String
En sträng.
- index
- Int32
Tecknets position som ska utvärderas i s.
Returer
trueom tecknet vid position index i s är ett skiljetecken, annars . false
Undantag
s är null.
index är mindre än noll eller större än den sista positionen i s.
Kommentarer
Teckenpositioner i en sträng indexeras från noll.
Giltiga skiljetecken är medlemmar i följande kategorier i : , , , , ClosePunctuation, InitialQuotePunctuation, FinalQuotePunctuationeller OtherPunctuation. OpenPunctuationDashPunctuationConnectorPunctuationUnicodeCategory De innehåller tecken med följande Unicode-kodpunkter:
- U+0021 till U+0023
- U+060C och U+060D
- U+1800 till U+180A
- U+3014 till U+301F
- U+0025 till U+002A
- U+061B
- U+1944 och U+1945
- U+3030
- U+002C till U+002F
- U+061E och U+061F
- U+19DE och U+19DF
- U+303D
- U+003A och U+003B
- U+066A till U+066D
- U+1A1E och U+1A1F
- U+30A0
- U+003F och U+0040
- U+06D4
- U+1B5A till U+1B60
- U+30FB
- U+005B till U+005D
- U+0700 till U+070D
- U+2010 till U+2027
- U+A874 till U+A877
- U+005F
- U+07F7 till U+07F9
- U+2030 till U+2043
- U+FD3E och U+FD3F
- U+007B
- U+0964 och U+0965
- U+2045 till U+2051
- U+FE10 till U+FE19
- U+007D
- U+0970
- U+2053 till U+205E
- U+FE30 till U+FE52
- U+00A1
- U+0DF4
- U+207D och U+207E
- U+FE54 till U+FE61
- U+00AB
- U+0E4F till U+0E5B
- U+208D och U+208E
- U+FE63
- U+00AD
- U+0F04 till U+0F12
- U+2329 och U+232A
- U+FE68
- U+00B7
- U+0F3A till U+0F3D
- U+2768 till U+2775
- U+FE6A och U+FE6B
- U+00BB
- U+0F85
- U+27C5 till U+27C6
- U+FF01 till U+FF03
- U+00BF
- U+0FD0 och U+0FD1
- U+27E6 till U+27EB
- U+FF05 till U+FF0A
- U+037E
- U+104A till U+104F
- U+2983 till U+2998
- U+FF0C till U+FF0F
- U+0387
- U+10FB
- U+29D8 till U+29DB
- U+FF1A och U+FF1B
- U+055A till U+055F
- U+1361 till U+1368
- U+29FC och U+29FD
- U+FF1F och U+FF20
- U+0589 och U+058A
- U+166D och U+166E
- U+2CF9 till U+2CFC
- U+FF3B till U+FF3D
- U+05BE
- U+169B och U+169C
- U+2CFE och U+2CFF
- U+FF3F
- U+05C0
- U+16EB till U+16ED
- U+2E00 till U+2E17
- U+FF5B
- U+05C3
- U+1735 och U+1736
- U+2E1C och U+2E1D
- U+FF5D
- U+05C6
- U+17D4 till U+17D6
- U+3001 till U+3003
- U+FF5F till U+FF65
- U+05F3 och U+05F4
- U+17D8 till U+17DA
- U+3008 till U+3011