C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet826/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   822   823   824   825   826   827   828   829   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

StringComparison

 is an enumeration that defines the values shown in Table 22-2. 

Using these values, it is possible to craft a comparison that meets the specific needs of your 

application. Thus, the addition of the 



StringComparison

 parameter expands the capabilities 

of

Compare( )

.

One particularly good use of the 



StringComparison

 form of 



Compare( )

 is to compare a 

string against an invariant file name or password. For example, imagine a situation in which 

the user must enter the password 



we~23&blx$

. This password is the same no matter what 

cultural settings are in effect. Thus, you want to compare the string entered by the user to 

the password without cultural differences affecting the comparison. One way to do this is 

Value

Description



CurrentCulture

Comparisons are per formed using the currently active 

cultural settings.

CurrentCultureIgnoreCase

Case-insensitive comparisons are per formed using the 

currently active cultural settings.

InvariantCulture

Comparisons are per formed using an invariant (that is, 

universal and unchanging) culture.

InvariantCultureIngoreCase

Case-insensitive comparisons are per formed using an 

invariant (that is, universal and unchanging) culture.

Ordinal

Comparisons are per formed using the ordinal values of the 

characters in the string. Thus, dictionar y-order may not result 

and cultural conventions are ignored.

OrdinalIgnoreCase

Case-insensitive comparisons are per formed using the ordinal 

values of the characters in the string. Thus, dictionar y-order 

may not result and cultural conventions are ignored.

T

ABLE


 22-2 

The


StringComparison

 Enumeration Values

www.freepdf-books.com



670

 

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

to specify 




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   822   823   824   825   826   827   828   829   ...   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