C# 0 The Complete Reference


PART II C h a p t e r   2 1



Download 4,07 Mb.
Pdf ko'rish
bet793/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   789   790   791   792   793   794   795   796   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt


PART II

C h a p t e r   2 1 :  

E x p l o r i n g   t h e   S y s t e m   N a m e s p a c e    

635


values are used to represent it. The first character is called the 

high surrogate

 and the second 

is called the 

low surrogate.

 In UTF-32, each code point uses one 32-bit value. 



Char

 provides 

the necessary conversions between UTF-16 and UTF-32.

Char

 defines the following fields:

public const char MaxValue

public const char MinValue

These represent the largest and smallest values that a 

char

 variable can hold.



Char

 implements the following interfaces: 



IComparable

,

IComparable

,

IConvertible

, and 


IEquatable

.

Field



Meaning

public static readonly decimal MaxValue

The largest value that a 

decimal


 can hold.

public static readonly decimal MinusOne

The 

decimal


 representation of –1.

public static readonly decimal MinValue

The smallest value that a 

decimal


 can hold.

public static readonly decimal One

The 

decimal


 representation of 1.

public static readonly decimal Zero

The 

decimal


 representation of 0.

T

ABLE



 21-8 

Fields Suppor ted by 

Decimal

Method


Meaning

public int CompareTo(char 



v

)

Compares the character in the invoking object 



with that of 

v.

 Returns zero if the characters are 

equal. Returns a negative value if the invoking 

object has a lower value. Returns a positive value 

if the invoking object has a greater value. 

public int CompareTo(object 



v

)

Compares the character in the invoking object 



with that of 

v.

 Returns zero if the characters are 

equal. Returns a negative value if the invoking 

object has a lower value. Returns a positive value 

if the invoking object has a greater value.

public static string

    Conver tFromUtf32(int 

utf32Ch

)

Conver ts the Unicode UTF-32 code point in 



utf32Ch

  into a UTF-16 string and returns the 

result. 

pubic static int

    Conver tToUtf32(char 

highSurrogate

,

                            char 



lowSurrogate

)

Conver ts the high and low UTF-16 surrogates 



specified by 

highSurrogate

 and 


lowSurrogate

 into 


a UTF-32 code point. The result is returned. 

pubic static int

     Conver tToUtf32(string str, int 

idx

)

Conver ts the UTF-16 surrogate pair at 



str

[

idx

] into 

its UTF-32 code point. The result is returned. 

public bool Equals(char 

v

)

Returns true if the value of the invoking object 



equals the value of 

v.

public override bool Equals(object 



v

)

Returns true if the value of the invoking object 



equals the value of 

v.

T

ABLE



 21-9 

Methods Defi ned by 

Char

www.freepdf-books.com




636

 

P a r t   I I :  



E x p l o r i n g   t h e   C #   L i b r a r y

public override int GetHashCode( )

Returns the hash code for the invoking object.

public static double GetNumericValue(char 



ch

)

Returns the numeric value of 



ch

 if 


ch

 is a digit. 

Other wise, returns –1.

public static double

    GetNumericValue(string 

str

, int 


idx

)

Returns the numeric value of 



str

[

idx

] if that 

character is a digit. Other wise, returns –1.

public TypeCode GetTypeCode( )

Returns the 

TypeCode

 enumeration value for 

Char

, which is 



TypeCode.Char

.

public static UnicodeCategor y



    GetUnicodeCategor y(char 

ch

)

Returns the 



UnicodeCategory

 enumeration value 

for

ch.

UnicodeCategory

 is an enumeration 

defined by 

System.Globalization

 that categorizes 

Unicode characters.

public static UnicodeCategor y

    GetUnicodeCategor y(string 

str

, int 


idx

)

Returns the 



UnicodeCategory

 enumeration value 

for

str

[

idx

].

UnicodeCategory



 is an enumeration 

defined by 

System.Globalization

that categorizes 

Unicode characters.

public static bool IsControl(char 



ch

)

Returns true if 



ch

 is a control character. 

Other wise, returns false. 

public static bool IsControl(string 



str

, int 


idx

)

Returns true if 



str

[

idx

] is a control character. 

Other wise, returns false. 

public static bool IsDigit(char 

ch

)

Returns true if 



ch

 is a digit. Other wise, returns 

false.

public static bool IsDigit(string 



str

, int 


idx

)

Returns true if 



str

[

idx

] is a digit. Other wise, 

returns false. 

public static bool IsHighSurrogate(char 

ch

)

Returns true if 



ch

 is a valid UTF-32 high 

surrogate. Other wise, returns false. 

public static bool IsHighSurrogate(string 



str

,

                                                   int 



idx

)

Returns true if 



str

[

idx

] is a valid UTF-32 high 

surrogate. Other wise, returns false. 

public static bool IsLetter(char 

ch

)

Returns true if 



ch

 is a letter of the alphabet. 

Other wise, returns false. 

public static bool IsLetter(string 



str

, int 


idx

)

Returns true if 



str

[

idx

] is a letter of the alphabet. 

Other wise, returns false. 

public static bool IsLetterOrDigit(char 

ch

)

Returns true if 



ch

 is either a letter of the alphabet 

or a digit. Other wise, returns false. 

public static bool

    IsLetterOrDigit(string 

str

, int 


idx

)

Returns true if 



str

[

idx

] is either a letter of the 

alphabet or a digit. Other wise, returns false. 

public static bool IsLower(char 

ch

)

Returns true if 



ch

 is a lowercase letter of the 

alphabet. Other wise, returns false. 

public static bool IsLower(string 



str

, int 


idx

)

Returns true if 



str

[

idx

] is a lowercase letter of the 

alphabet. Other wise, returns false. 

T

ABLE


 21-9 

Methods Defi ned by 

Char

(continued)

Method


Meaning

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   789   790   791   792   793   794   795   796   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish