Char 结构

定义

将字符表示为 UTF-16 代码单位。

public value class char : IComparable, IComparable<char>, IConvertible, IEquatable<char>
public value class char : IComparable, IComparable<char>, IConvertible, IEquatable<char>, ISpanFormattable
public value class char : IComparable<char>, IConvertible, IEquatable<char>, IParsable<char>, ISpanParsable<char>, System::Numerics::IAdditionOperators<char, char, char>, System::Numerics::IAdditiveIdentity<char, char>, System::Numerics::IBinaryInteger<char>, System::Numerics::IBinaryNumber<char>, System::Numerics::IBitwiseOperators<char, char, char>, System::Numerics::IComparisonOperators<char, char, bool>, System::Numerics::IDecrementOperators<char>, System::Numerics::IDivisionOperators<char, char, char>, System::Numerics::IEqualityOperators<char, char, bool>, System::Numerics::IIncrementOperators<char>, System::Numerics::IMinMaxValue<char>, System::Numerics::IModulusOperators<char, char, char>, System::Numerics::IMultiplicativeIdentity<char, char>, System::Numerics::IMultiplyOperators<char, char, char>, System::Numerics::INumber<char>, System::Numerics::INumberBase<char>, System::Numerics::IShiftOperators<char, int, char>, System::Numerics::ISubtractionOperators<char, char, char>, System::Numerics::IUnaryNegationOperators<char, char>, System::Numerics::IUnaryPlusOperators<char, char>, System::Numerics::IUnsignedNumber<char>
public value class char : IComparable<char>, IConvertible, IEquatable<char>, IParsable<char>, ISpanParsable<char>, IUtf8SpanParsable<char>, System::Numerics::IAdditionOperators<char, char, char>, System::Numerics::IAdditiveIdentity<char, char>, System::Numerics::IBinaryInteger<char>, System::Numerics::IBinaryNumber<char>, System::Numerics::IBitwiseOperators<char, char, char>, System::Numerics::IComparisonOperators<char, char, bool>, System::Numerics::IDecrementOperators<char>, System::Numerics::IDivisionOperators<char, char, char>, System::Numerics::IEqualityOperators<char, char, bool>, System::Numerics::IIncrementOperators<char>, System::Numerics::IMinMaxValue<char>, System::Numerics::IModulusOperators<char, char, char>, System::Numerics::IMultiplicativeIdentity<char, char>, System::Numerics::IMultiplyOperators<char, char, char>, System::Numerics::INumber<char>, System::Numerics::INumberBase<char>, System::Numerics::IShiftOperators<char, int, char>, System::Numerics::ISubtractionOperators<char, char, char>, System::Numerics::IUnaryNegationOperators<char, char>, System::Numerics::IUnaryPlusOperators<char, char>, System::Numerics::IUnsignedNumber<char>
public value class char : IComparable, IConvertible
public value class char : IComparable, IComparable<char>, IEquatable<char>
public struct Char : IComparable, IComparable<char>, IConvertible, IEquatable<char>
public readonly struct Char : IComparable, IComparable<char>, IConvertible, IEquatable<char>
public readonly struct Char : IComparable, IComparable<char>, IConvertible, IEquatable<char>, ISpanFormattable
public readonly struct Char : IComparable<char>, IConvertible, IEquatable<char>, IParsable<char>, ISpanParsable<char>, System.Numerics.IAdditionOperators<char,char,char>, System.Numerics.IAdditiveIdentity<char,char>, System.Numerics.IBinaryInteger<char>, System.Numerics.IBinaryNumber<char>, System.Numerics.IBitwiseOperators<char,char,char>, System.Numerics.IComparisonOperators<char,char,bool>, System.Numerics.IDecrementOperators<char>, System.Numerics.IDivisionOperators<char,char,char>, System.Numerics.IEqualityOperators<char,char,bool>, System.Numerics.IIncrementOperators<char>, System.Numerics.IMinMaxValue<char>, System.Numerics.IModulusOperators<char,char,char>, System.Numerics.IMultiplicativeIdentity<char,char>, System.Numerics.IMultiplyOperators<char,char,char>, System.Numerics.INumber<char>, System.Numerics.INumberBase<char>, System.Numerics.IShiftOperators<char,int,char>, System.Numerics.ISubtractionOperators<char,char,char>, System.Numerics.IUnaryNegationOperators<char,char>, System.Numerics.IUnaryPlusOperators<char,char>, System.Numerics.IUnsignedNumber<char>
public readonly struct Char : IComparable<char>, IConvertible, IEquatable<char>, IParsable<char>, ISpanParsable<char>, IUtf8SpanParsable<char>, System.Numerics.IAdditionOperators<char,char,char>, System.Numerics.IAdditiveIdentity<char,char>, System.Numerics.IBinaryInteger<char>, System.Numerics.IBinaryNumber<char>, System.Numerics.IBitwiseOperators<char,char,char>, System.Numerics.IComparisonOperators<char,char,bool>, System.Numerics.IDecrementOperators<char>, System.Numerics.IDivisionOperators<char,char,char>, System.Numerics.IEqualityOperators<char,char,bool>, System.Numerics.IIncrementOperators<char>, System.Numerics.IMinMaxValue<char>, System.Numerics.IModulusOperators<char,char,char>, System.Numerics.IMultiplicativeIdentity<char,char>, System.Numerics.IMultiplyOperators<char,char,char>, System.Numerics.INumber<char>, System.Numerics.INumberBase<char>, System.Numerics.IShiftOperators<char,int,char>, System.Numerics.ISubtractionOperators<char,char,char>, System.Numerics.IUnaryNegationOperators<char,char>, System.Numerics.IUnaryPlusOperators<char,char>, System.Numerics.IUnsignedNumber<char>
[System.Serializable]
public struct Char : IComparable, IConvertible
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct Char : IComparable, IComparable<char>, IConvertible, IEquatable<char>
public struct Char : IComparable, IComparable<char>, IEquatable<char>
type char = struct
    interface IConvertible
type char = struct
    interface IConvertible
    interface ISpanFormattable
    interface IFormattable
type char = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<char>
    interface ISpanFormattable
    interface ISpanParsable<char>
    interface IAdditionOperators<char, char, char>
    interface IAdditiveIdentity<char, char>
    interface IBinaryInteger<char>
    interface IBinaryNumber<char>
    interface IBitwiseOperators<char, char, char>
    interface IComparisonOperators<char, char, bool>
    interface IEqualityOperators<char, char, bool>
    interface IDecrementOperators<char>
    interface IDivisionOperators<char, char, char>
    interface IIncrementOperators<char>
    interface IModulusOperators<char, char, char>
    interface IMultiplicativeIdentity<char, char>
    interface IMultiplyOperators<char, char, char>
    interface INumber<char>
    interface INumberBase<char>
    interface ISubtractionOperators<char, char, char>
    interface IUnaryNegationOperators<char, char>
    interface IUnaryPlusOperators<char, char>
    interface IShiftOperators<char, int, char>
    interface IMinMaxValue<char>
    interface IUnsignedNumber<char>
type char = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<char>
    interface ISpanFormattable
    interface ISpanParsable<char>
    interface IAdditionOperators<char, char, char>
    interface IAdditiveIdentity<char, char>
    interface IBinaryInteger<char>
    interface IBinaryNumber<char>
    interface IBitwiseOperators<char, char, char>
    interface IComparisonOperators<char, char, bool>
    interface IEqualityOperators<char, char, bool>
    interface IDecrementOperators<char>
    interface IDivisionOperators<char, char, char>
    interface IIncrementOperators<char>
    interface IModulusOperators<char, char, char>
    interface IMultiplicativeIdentity<char, char>
    interface IMultiplyOperators<char, char, char>
    interface INumber<char>
    interface INumberBase<char>
    interface ISubtractionOperators<char, char, char>
    interface IUnaryNegationOperators<char, char>
    interface IUnaryPlusOperators<char, char>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<char>
    interface IShiftOperators<char, int, char>
    interface IMinMaxValue<char>
    interface IUnsignedNumber<char>
type char = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<char>
    interface ISpanFormattable
    interface ISpanParsable<char>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<char>
    interface IAdditionOperators<char, char, char>
    interface IAdditiveIdentity<char, char>
    interface IBinaryInteger<char>
    interface IBinaryNumber<char>
    interface IBitwiseOperators<char, char, char>
    interface IComparisonOperators<char, char, bool>
    interface IEqualityOperators<char, char, bool>
    interface IDecrementOperators<char>
    interface IDivisionOperators<char, char, char>
    interface IIncrementOperators<char>
    interface IModulusOperators<char, char, char>
    interface IMultiplicativeIdentity<char, char>
    interface IMultiplyOperators<char, char, char>
    interface INumber<char>
    interface INumberBase<char>
    interface ISubtractionOperators<char, char, char>
    interface IUnaryNegationOperators<char, char>
    interface IUnaryPlusOperators<char, char>
    interface IShiftOperators<char, int, char>
    interface IMinMaxValue<char>
    interface IUnsignedNumber<char>
[<System.Serializable>]
type char = struct
    interface IConvertible
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type char = struct
    interface IConvertible
type char = struct
Public Structure Char
Implements IComparable, IComparable(Of Char), IConvertible, IEquatable(Of Char)
Public Structure Char
Implements IComparable, IComparable(Of Char), IConvertible, IEquatable(Of Char), ISpanFormattable
Public Structure Char
Implements IAdditionOperators(Of Char, Char, Char), IAdditiveIdentity(Of Char, Char), IBinaryInteger(Of Char), IBinaryNumber(Of Char), IBitwiseOperators(Of Char, Char, Char), IComparable(Of Char), IComparisonOperators(Of Char, Char, Boolean), IConvertible, IDecrementOperators(Of Char), IDivisionOperators(Of Char, Char, Char), IEqualityOperators(Of Char, Char, Boolean), IEquatable(Of Char), IIncrementOperators(Of Char), IMinMaxValue(Of Char), IModulusOperators(Of Char, Char, Char), IMultiplicativeIdentity(Of Char, Char), IMultiplyOperators(Of Char, Char, Char), INumber(Of Char), INumberBase(Of Char), IParsable(Of Char), IShiftOperators(Of Char, Integer, Char), ISpanParsable(Of Char), ISubtractionOperators(Of Char, Char, Char), IUnaryNegationOperators(Of Char, Char), IUnaryPlusOperators(Of Char, Char), IUnsignedNumber(Of Char)
Public Structure Char
Implements IAdditionOperators(Of Char, Char, Char), IAdditiveIdentity(Of Char, Char), IBinaryInteger(Of Char), IBinaryNumber(Of Char), IBitwiseOperators(Of Char, Char, Char), IComparable(Of Char), IComparisonOperators(Of Char, Char, Boolean), IConvertible, IDecrementOperators(Of Char), IDivisionOperators(Of Char, Char, Char), IEqualityOperators(Of Char, Char, Boolean), IEquatable(Of Char), IIncrementOperators(Of Char), IMinMaxValue(Of Char), IModulusOperators(Of Char, Char, Char), IMultiplicativeIdentity(Of Char, Char), IMultiplyOperators(Of Char, Char, Char), INumber(Of Char), INumberBase(Of Char), IParsable(Of Char), IShiftOperators(Of Char, Integer, Char), ISpanParsable(Of Char), ISubtractionOperators(Of Char, Char, Char), IUnaryNegationOperators(Of Char, Char), IUnaryPlusOperators(Of Char, Char), IUnsignedNumber(Of Char), IUtf8SpanParsable(Of Char)
Public Structure Char
Implements IComparable, IConvertible
Public Structure Char
Implements IComparable, IComparable(Of Char), IEquatable(Of Char)
继承
属性
实现
IComparable IComparable<Char> IConvertible IEquatable<Char> IFormattable ISpanFormattable IComparable<TSelf> IEquatable<TSelf> IParsable<Char> IParsable<TSelf> ISpanParsable<Char> ISpanParsable<TSelf> IAdditionOperators<Char,Char,Char> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<Char,Char> IAdditiveIdentity<TSelf,TSelf> IBinaryInteger<Char> IBinaryNumber<Char> IBinaryNumber<TSelf> IBitwiseOperators<Char,Char,Char> IBitwiseOperators<TSelf,TSelf,TSelf> IComparisonOperators<Char,Char,Boolean> IComparisonOperators<TSelf,TSelf,Boolean> IDecrementOperators<Char> IDecrementOperators<TSelf> IDivisionOperators<Char,Char,Char> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<Char,Char,Boolean> IEqualityOperators<TSelf,TOther,TResult> IEqualityOperators<TSelf,TSelf,Boolean> IIncrementOperators<Char> IIncrementOperators<TSelf> IMinMaxValue<Char> IModulusOperators<Char,Char,Char> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<Char,Char> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<Char,Char,Char> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<Char> INumber<TSelf> INumberBase<Char> INumberBase<TSelf> IShiftOperators<Char,Int32,Char> IShiftOperators<TSelf,Int32,TSelf> ISubtractionOperators<Char,Char,Char> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<Char,Char> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<Char,Char> IUnaryPlusOperators<TSelf,TSelf> IUnsignedNumber<Char> IUtf8SpanFormattable IUtf8SpanParsable<Char> IUtf8SpanParsable<TSelf>

示例

下面的代码示例演示 中的 Char一些方法。

using namespace System;
int main()
{
   char chA = 'A';
   char ch1 = '1';
   String^ str =  "test string";
   Console::WriteLine( chA.CompareTo( 'B' ) ); // Output: "-1" (meaning 'A' is 1 less than 'B')
   Console::WriteLine( chA.Equals( 'A' ) ); // Output: "True"
   Console::WriteLine( Char::GetNumericValue( ch1 ) ); // Output: "1"
   Console::WriteLine( Char::IsControl( '\t' ) ); // Output: "True"
   Console::WriteLine( Char::IsDigit( ch1 ) ); // Output: "True"
   Console::WriteLine( Char::IsLetter( ',' ) ); // Output: "False"
   Console::WriteLine( Char::IsLower( 'u' ) ); // Output: "True"
   Console::WriteLine( Char::IsNumber( ch1 ) ); // Output: "True"
   Console::WriteLine( Char::IsPunctuation( '.' ) ); // Output: "True"
   Console::WriteLine( Char::IsSeparator( str, 4 ) ); // Output: "True"
   Console::WriteLine( Char::IsSymbol( '+' ) ); // Output: "True"
   Console::WriteLine( Char::IsWhiteSpace( str, 4 ) ); // Output: "True"
   Console::WriteLine( Char::Parse(  "S" ) ); // Output: "S"
   Console::WriteLine( Char::ToLower( 'M' ) ); // Output: "m"
   Console::WriteLine( 'x' ); // Output: "x"
}
using System;

public class CharStructureSample
{
    public static void Main()
    {
        char chA = 'A';
        char ch1 = '1';
        string str = "test string";

        Console.WriteLine(chA.CompareTo('B'));          //-----------  Output: "-1" (meaning 'A' is 1 less than 'B')
        Console.WriteLine(chA.Equals('A'));             //-----------  Output: "True"
        Console.WriteLine(Char.GetNumericValue(ch1));   //-----------  Output: "1"
        Console.WriteLine(Char.IsControl('\t'));        //-----------  Output: "True"
        Console.WriteLine(Char.IsDigit(ch1));           //-----------  Output: "True"
        Console.WriteLine(Char.IsLetter(','));          //-----------  Output: "False"
        Console.WriteLine(Char.IsLower('u'));           //-----------  Output: "True"
        Console.WriteLine(Char.IsNumber(ch1));          //-----------  Output: "True"
        Console.WriteLine(Char.IsPunctuation('.'));     //-----------  Output: "True"
        Console.WriteLine(Char.IsSeparator(str, 4));    //-----------  Output: "True"
        Console.WriteLine(Char.IsSymbol('+'));          //-----------  Output: "True"
        Console.WriteLine(Char.IsWhiteSpace(str, 4));   //-----------  Output: "True"
        Console.WriteLine(Char.Parse("S"));             //-----------  Output: "S"
        Console.WriteLine(Char.ToLower('M'));           //-----------  Output: "m"
        Console.WriteLine('x'.ToString());              //-----------  Output: "x"
    }
}
open System

let chA = 'A'
let ch1 = '1'
let str = "test string"

printfn $"{chA.CompareTo 'B'}"          //-----------  Output: "-1" (meaning 'A' is 1 less than 'B')
printfn $"{chA.Equals 'A'}"             //-----------  Output: "True"
printfn $"{Char.GetNumericValue ch1}"   //-----------  Output: "1"
printfn $"{Char.IsControl '\t'}"        //-----------  Output: "True"
printfn $"{Char.IsDigit ch1}"           //-----------  Output: "True"
printfn $"{Char.IsLetter ','}"          //-----------  Output: "False"
printfn $"{Char.IsLower 'u'}"           //-----------  Output: "True"
printfn $"{Char.IsNumber ch1}"          //-----------  Output: "True"
printfn $"{Char.IsPunctuation '.'}"     //-----------  Output: "True"
printfn $"{Char.IsSeparator(str, 4)}"   //-----------  Output: "True"
printfn $"{Char.IsSymbol '+'}"          //-----------  Output: "True"
printfn $"{Char.IsWhiteSpace(str, 4)}"  //-----------  Output: "True"
printfn $"""{Char.Parse "S"}"""         //-----------  Output: "S"
printfn $"{Char.ToLower 'M'}"           //-----------  Output: "m"
printfn $"{'x'}"                        //-----------  Output: "x"
Module CharStructure

    Public Sub Main()

        Dim chA As Char
        chA = "A"c
        Dim ch1 As Char
        ch1 = "1"c
        Dim str As String
        str = "test string"

        Console.WriteLine(chA.CompareTo("B"c))          ' Output: "-1" (meaning 'A' is 1 less than 'B')
        Console.WriteLine(chA.Equals("A"c))             ' Output: "True"
        Console.WriteLine(Char.GetNumericValue(ch1))    ' Output: "1"
        Console.WriteLine(Char.IsControl(Chr(9)))       ' Output: "True"
        Console.WriteLine(Char.IsDigit(ch1))            ' Output: "True"
        Console.WriteLine(Char.IsLetter(","c))          ' Output: "False"
        Console.WriteLine(Char.IsLower("u"c))           ' Output: "True"
        Console.WriteLine(Char.IsNumber(ch1))           ' Output: "True"
        Console.WriteLine(Char.IsPunctuation("."c))     ' Output: "True"
        Console.WriteLine(Char.IsSeparator(str, 4))     ' Output: "True"
        Console.WriteLine(Char.IsSymbol("+"c))          ' Output: "True"
        Console.WriteLine(Char.IsWhiteSpace(str, 4))    ' Output: "True"
        Console.WriteLine(Char.Parse("S"))              ' Output: "S"
        Console.WriteLine(Char.ToLower("M"c))           ' Output: "m"
        Console.WriteLine("x"c.ToString())              ' Output: "x"

    End Sub

End Module

注解

有关此 API 的详细信息,请参阅 Char 的补充 API 说明

字段

MaxValue

表示 Char 的最大可能值。 此字段为常数。

MinValue

表示 Char 的最小可能值。 此字段为常数。

方法

CompareTo(Char)

将此实例与指定的 Char 对象进行比较,并指示此实例在排序顺序中是位于指定的 Char 对象之前、之后还是与其出现在同一位置。

CompareTo(Object)

将此实例与指定的对象进行比较,并指示此实例在排序顺序中是位于指定的 Object 之前、之后还是与其出现在同一位置。

ConvertFromUtf32(Int32)

将指定的 Unicode 码位转换为 UTF-16 编码字符串。

ConvertToUtf32(Char, Char)

将 UTF-16 编码的代理项对的值转换为 Unicode 码位。

ConvertToUtf32(String, Int32)

将字符串中指定位置的 UTF-16 编码字符或代理项对的值转换为 Unicode 码位。

Equals(Char)

返回一个值,该值指示此实例是否与指定的 Char 对象相等。

Equals(Object)

返回一个值,该值指示此实例是否与指定的对象相等。

GetHashCode()

返回此实例的哈希代码。

GetNumericValue(Char)

将指定的数字 Unicode 字符转换为双精度浮点数。

GetNumericValue(String, Int32)

将指定字符串中位于指定位置的数字 Unicode 字符转换为双精度浮点数。

GetTypeCode()

返回值类型 TypeCodeChar

GetUnicodeCategory(Char)

将指定的 Unicode 字符分类到由一个 UnicodeCategory 值标识的组中。

GetUnicodeCategory(String, Int32)

将指定字符串中位于指定位置的字符分类到由一个 UnicodeCategory 值标识的组中。

IsAscii(Char)

true如果 c 是 ASCII 字符 ([ U+0000..U+007F ]) ,则返回 。

IsAsciiDigit(Char)

指示字符是否分类为 ASCII 数字。

IsAsciiHexDigit(Char)

指示字符是否分类为 ASCII 六边形数字。

IsAsciiHexDigitLower(Char)

指示字符是否分类为 ASCII 小写六进制数字。

IsAsciiHexDigitUpper(Char)

指示字符是否归类为 ASCII 大写六边形数字。

IsAsciiLetter(Char)

指示字符是否归类为 ASCII 字母。

IsAsciiLetterLower(Char)

指示字符是否分类为小写 ASCII 字母。

IsAsciiLetterOrDigit(Char)

指示字符是分类为 ASCII 字母还是数字。

IsAsciiLetterUpper(Char)

指示字符是否归类为大写 ASCII 字母。

IsBetween(Char, Char, Char)

指示字符是否在指定的非独占范围内。

IsControl(Char)

指示指定的 Unicode 字符是否属于控制字符类别。

IsControl(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于控制字符类别。

IsDigit(Char)

指示指定的 Unicode 字符是否属于十进制数字类别。

IsDigit(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于十进制数字类别。

IsHighSurrogate(Char)

指示指定的 Char 对象是否是一个高代理项。

IsHighSurrogate(String, Int32)

指示字符串中指定位置处的 Char 对象是否为高代理项。

IsLetter(Char)

指示指定的 Unicode 字符是否属于 Unicode 字母类别。

IsLetter(String, Int32)

指示指定字符串中位于指定位置处的指定字符串是否属于 Unicode 字母类别。

IsLetterOrDigit(Char)

指示指定的 Unicode 字符是否属于字母或十进制数字类别。

IsLetterOrDigit(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于字母或十进制数字类别。

IsLower(Char)

指示指定的 Unicode 字符是否属于小写字母类别。

IsLower(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于小写字母类别。

IsLowSurrogate(Char)

指示指定的 Char 对象是否是一个低代理项。

IsLowSurrogate(String, Int32)

指示字符串中指定位置处的 Char 对象是否为低代理项。

IsNumber(Char)

指示指定的 Unicode 字符是否属于数字类别。

IsNumber(String, Int32)

指示指定字符串中位于指定位置的字符是否属于数字类别。

IsPunctuation(Char)

指示指定的 Unicode 字符是否属于标点符号类别。

IsPunctuation(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于标点符号类别。

IsSeparator(Char)

指示指定的 Unicode 字符是否属于分隔符类别。

IsSeparator(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于分隔符类别。

IsSurrogate(Char)

指示指定的字符是否具有指定的代理项代码单位。

IsSurrogate(String, Int32)

指示指定字符串中位于指定位置的字符是否具有代理项代码单位。

IsSurrogatePair(Char, Char)

指示两个指定的 Char 对象是否形成一个代理项对。

IsSurrogatePair(String, Int32)

指示字符串中指定位置处的两个相邻 Char 对象是否形成一个代理项对。

IsSymbol(Char)

指示指定的 Unicode 字符是否属于符号字符类别。

IsSymbol(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于符号字符类别。

IsUpper(Char)

指示指定的 Unicode 字符是否属于大写字母类别。

IsUpper(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于大写字母类别。

IsWhiteSpace(Char)

指示指定的 Unicode 字符是否属于空格类别。

IsWhiteSpace(String, Int32)

指示指定字符串中位于指定位置处的字符是否属于空格类别。

Parse(String)

将指定字符串的值转换为它的等效 Unicode 字符。

ToLower(Char)

将 Unicode 字符的值转换为它的小写等效项。

ToLower(Char, CultureInfo)

使用指定的区域性特定格式设置信息将指定 Unicode 字符的值转换为它的小写等效项。

ToLowerInvariant(Char)

使用固定区域性的大小写规则,将 Unicode 字符的值转换为其小写等效项。

ToString()

将此实例的值转换为其等效的字符串表示形式。

ToString(Char)

将指定的 Unicode 字符转换为它的等效字符串表示形式。

ToString(IFormatProvider)

使用指定的区域性特定格式信息将此实例的值转换为它的等效字符串表示形式。

ToUpper(Char)

将 Unicode 字符的值转换为它的大写等效项。

ToUpper(Char, CultureInfo)

使用指定的区域性特定格式设置信息将指定 Unicode 字符的值转换为它的大写等效项。

ToUpperInvariant(Char)

使用固定区域性的大小写规则,将 Unicode 字符的值转换为其大写等效项。

TryParse(String, Char)

将指定字符串的值转换为它的等效 Unicode 字符。 一个指示转换是成功还是失败的返回代码。

显式接口实现

IAdditionOperators<Char,Char,Char>.Addition(Char, Char)

将两个值相加以计算其和。

IAdditionOperators<Char,Char,Char>.CheckedAddition(Char, Char)

将两个值相加以计算其和。

IAdditiveIdentity<Char,Char>.AdditiveIdentity

获取当前类型的加法标识。

IBinaryInteger<Char>.GetByteCount()

获取将作为 的一部分写入的 TryWriteLittleEndian(Span<Byte>, Int32)字节数。

IBinaryInteger<Char>.GetShortestBitLength()

获取当前值的最短两个的补补表示形式的长度(以位为单位)。

IBinaryInteger<Char>.LeadingZeroCount(Char)

计算值中前导零位的数目。

IBinaryInteger<Char>.PopCount(Char)

计算值中设置的位数。

IBinaryInteger<Char>.RotateLeft(Char, Int32)

按给定量旋转剩余的值。

IBinaryInteger<Char>.RotateRight(Char, Int32)

将值向右旋转给定的量。

IBinaryInteger<Char>.TrailingZeroCount(Char)

计算值中尾随零位的数目。

IBinaryInteger<Char>.TryReadBigEndian(ReadOnlySpan<Byte>, Boolean, Char)

将字符表示为 UTF-16 代码单位。

IBinaryInteger<Char>.TryReadLittleEndian(ReadOnlySpan<Byte>, Boolean, Char)

将字符表示为 UTF-16 代码单位。

IBinaryInteger<Char>.TryWriteBigEndian(Span<Byte>, Int32)

尝试以 big-endian 格式将当前值写入给定范围。

IBinaryInteger<Char>.TryWriteLittleEndian(Span<Byte>, Int32)

尝试以 little-endian 格式将当前值写入给定范围。

IBinaryNumber<Char>.AllBitsSet

获取二进制类型的实例,其中设置了所有位。

IBinaryNumber<Char>.IsPow2(Char)

确定值是否为 2 的幂。

IBinaryNumber<Char>.Log2(Char)

计算值的 log2。

IBitwiseOperators<Char,Char,Char>.BitwiseAnd(Char, Char)

计算两个值的按位和 。

IBitwiseOperators<Char,Char,Char>.BitwiseOr(Char, Char)

计算两个值的按位或 。

IBitwiseOperators<Char,Char,Char>.ExclusiveOr(Char, Char)

计算两个值的独占或两个值。

IBitwiseOperators<Char,Char,Char>.OnesComplement(Char)

计算给定值的补补表示形式。

IComparable.CompareTo(Object)

将当前实例与同一类型的另一个对象进行比较,并返回一个整数,该整数指示当前实例在排序顺序中的位置是位于另一个对象之前、之后还是与其位置相同。

IComparisonOperators<Char,Char,Boolean>.GreaterThan(Char, Char)

比较两个值以确定哪个值更大。

IComparisonOperators<Char,Char,Boolean>.GreaterThanOrEqual(Char, Char)

比较两个值以确定哪个值更大或相等。

IComparisonOperators<Char,Char,Boolean>.LessThan(Char, Char)

比较两个值以确定哪个值较小。

IComparisonOperators<Char,Char,Boolean>.LessThanOrEqual(Char, Char)

比较两个值以确定哪个值小于或等于。

IConvertible.GetTypeCode()

返回此实例的 TypeCode

IConvertible.ToBoolean(IFormatProvider)

注意不支持此转换。 尝试这样做会引发 InvalidCastException

IConvertible.ToByte(IFormatProvider)

有关此成员的说明,请参见 ToByte(IFormatProvider)

IConvertible.ToChar(IFormatProvider)

有关此成员的说明,请参见 ToChar(IFormatProvider)

IConvertible.ToDateTime(IFormatProvider)

注意不支持此转换。 尝试这样做会引发 InvalidCastException

IConvertible.ToDecimal(IFormatProvider)

注意不支持此转换。 尝试这样做会引发 InvalidCastException

IConvertible.ToDouble(IFormatProvider)

注意不支持此转换。 尝试这样做会引发 InvalidCastException

IConvertible.ToInt16(IFormatProvider)

有关此成员的说明,请参见 ToInt16(IFormatProvider)

IConvertible.ToInt32(IFormatProvider)

有关此成员的说明,请参见 ToInt32(IFormatProvider)

IConvertible.ToInt64(IFormatProvider)

有关此成员的说明,请参见 ToInt64(IFormatProvider)

IConvertible.ToSByte(IFormatProvider)

有关此成员的说明,请参见 ToSByte(IFormatProvider)

IConvertible.ToSingle(IFormatProvider)

注意不支持此转换。 尝试这样做会引发 InvalidCastException

IConvertible.ToString(IFormatProvider)

使用指定的区域性特定格式设置信息将此实例的值转换为等效的字符串。

IConvertible.ToType(Type, IFormatProvider)

有关此成员的说明,请参见 ToType(Type, IFormatProvider)

IConvertible.ToUInt16(IFormatProvider)

有关此成员的说明,请参见 ToUInt16(IFormatProvider)

IConvertible.ToUInt32(IFormatProvider)

有关此成员的说明,请参见 ToUInt32(IFormatProvider)

IConvertible.ToUInt64(IFormatProvider)

有关此成员的说明,请参见 ToUInt64(IFormatProvider)

IDecrementOperators<Char>.CheckedDecrement(Char)

递减值。

IDecrementOperators<Char>.Decrement(Char)

递减值。

IDivisionOperators<Char,Char,Char>.Division(Char, Char)

将一个值除以另一个值以计算其商。

IEqualityOperators<Char,Char,Boolean>.Equality(Char, Char)

比较两个值以确定相等性。

IEqualityOperators<Char,Char,Boolean>.Inequality(Char, Char)

比较两个值以确定不相等性。

IFormattable.ToString(String, IFormatProvider)

使用指定格式对当前实例的值设置格式。

IIncrementOperators<Char>.CheckedIncrement(Char)

递增值。

IIncrementOperators<Char>.Increment(Char)

递增值。

IMinMaxValue<Char>.MaxValue

获取当前类型的最大值。

IMinMaxValue<Char>.MinValue

获取当前类型的最小值。

IModulusOperators<Char,Char,Char>.Modulus(Char, Char)

将两个值相除以计算其模数或余数。

IMultiplicativeIdentity<Char,Char>.MultiplicativeIdentity

获取当前类型的乘法标识。

IMultiplyOperators<Char,Char,Char>.CheckedMultiply(Char, Char)

将两个值相乘以计算其乘积。

IMultiplyOperators<Char,Char,Char>.Multiply(Char, Char)

将两个值相乘以计算其乘积。

INumberBase<Char>.Abs(Char)

计算值的绝对值。

INumberBase<Char>.IsCanonical(Char)

确定值是否在其规范表示形式中。

INumberBase<Char>.IsComplexNumber(Char)

确定值是否表示复数。

INumberBase<Char>.IsEvenInteger(Char)

确定值是否表示偶数整数。

INumberBase<Char>.IsFinite(Char)

确定值是否为有限值。

INumberBase<Char>.IsImaginaryNumber(Char)

确定值是否表示纯虚数。

INumberBase<Char>.IsInfinity(Char)

确定值是否无限。

INumberBase<Char>.IsInteger(Char)

确定值是否表示整型数。

INumberBase<Char>.IsNaN(Char)

确定值是否为 NaN。

INumberBase<Char>.IsNegative(Char)

确定值是否为负值。

INumberBase<Char>.IsNegativeInfinity(Char)

确定值是否为负无穷大。

INumberBase<Char>.IsNormal(Char)

确定值是否正常。

INumberBase<Char>.IsOddInteger(Char)

确定值是否表示奇数整数。

INumberBase<Char>.IsPositive(Char)

确定值是否为正值。

INumberBase<Char>.IsPositiveInfinity(Char)

确定值是否为正无穷大。

INumberBase<Char>.IsRealNumber(Char)

确定值是否表示实数。

INumberBase<Char>.IsSubnormal(Char)

确定值是否为非正常值。

INumberBase<Char>.IsZero(Char)

确定值是否为零。

INumberBase<Char>.MaxMagnitude(Char, Char)

将两个值与更大的计算进行比较。

INumberBase<Char>.MaxMagnitudeNumber(Char, Char)

将两个值进行比较,以计算其具有更大的数量级并返回另一个值(如果输入为 NaN)。

INumberBase<Char>.MinMagnitude(Char, Char)

将两个值与较小的计算进行比较。

INumberBase<Char>.MinMagnitudeNumber(Char, Char)

将两个值进行比较,以计算其数量级较小并返回另一个值(如果输入为 NaN)。

INumberBase<Char>.One

获取类型的值 1

INumberBase<Char>.Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

将字符范围解析为值。

INumberBase<Char>.Parse(String, NumberStyles, IFormatProvider)

将字符串分析为值。

INumberBase<Char>.Radix

获取类型的基数。

INumberBase<Char>.TryConvertFromChecked<TOther>(TOther, Char)

将字符表示为 UTF-16 代码单位。

INumberBase<Char>.TryConvertFromSaturating<TOther>(TOther, Char)

将字符表示为 UTF-16 代码单位。

INumberBase<Char>.TryConvertFromTruncating<TOther>(TOther, Char)

将字符表示为 UTF-16 代码单位。

INumberBase<Char>.TryConvertToChecked<TOther>(Char, TOther)

尝试将当前类型的实例转换为另一种类型,从而引发超出当前类型可表示范围的任何值的溢出异常。

INumberBase<Char>.TryConvertToSaturating<TOther>(Char, TOther)

尝试将当前类型的实例转换为另一种类型,使超出当前类型可表示范围的任何值饱和。

INumberBase<Char>.TryConvertToTruncating<TOther>(Char, TOther)

尝试将当前类型的实例转换为另一种类型,截断当前类型可表示范围之外的任何值。

INumberBase<Char>.TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Char)

将字符表示为 UTF-16 代码单位。

INumberBase<Char>.TryParse(String, NumberStyles, IFormatProvider, Char)

将字符表示为 UTF-16 代码单位。

INumberBase<Char>.Zero

获取类型的值 0

IParsable<Char>.Parse(String, IFormatProvider)

将字符串分析为值。

IParsable<Char>.TryParse(String, IFormatProvider, Char)

将字符表示为 UTF-16 代码单位。

IShiftOperators<Char,Int32,Char>.LeftShift(Char, Int32)

将一个值左移一个给定的量。

IShiftOperators<Char,Int32,Char>.RightShift(Char, Int32)

将值向右移动给定的量。

IShiftOperators<Char,Int32,Char>.UnsignedRightShift(Char, Int32)

将值向右移动给定的量。

ISpanFormattable.TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

尝试将当前实例的值格式化为提供的字符范围。

ISpanParsable<Char>.Parse(ReadOnlySpan<Char>, IFormatProvider)

将字符范围分析为值。

ISpanParsable<Char>.TryParse(ReadOnlySpan<Char>, IFormatProvider, Char)

将字符表示为 UTF-16 代码单位。

ISubtractionOperators<Char,Char,Char>.CheckedSubtraction(Char, Char)

减去两个值以计算它们的差值。

ISubtractionOperators<Char,Char,Char>.Subtraction(Char, Char)

减去两个值以计算它们的差值。

IUnaryNegationOperators<Char,Char>.CheckedUnaryNegation(Char)

计算值的检查一元求反。

IUnaryNegationOperators<Char,Char>.UnaryNegation(Char)

计算值的一元求反。

IUnaryPlusOperators<Char,Char>.UnaryPlus(Char)

计算值的一元加号。

IUtf8SpanFormattable.TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

尝试将当前实例的值格式化为 UTF-8,将其设置为提供的字节范围。

适用于

线程安全性

此类型的所有成员都是线程安全的。 看起来修改实例状态的成员实际上返回使用新值初始化的新实例。 与任何其他类型一样,读取和写入包含此类型的实例的共享变量必须受到锁的保护,以确保线程安全。

另请参阅