C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet832/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   828   829   830   831   832   833   834   835   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

Int32.ToString( )

 is invoked to obtain the string representation of the integer value 19. 



Concat( )

 then concatenates the strings and returns the result.

Also notice how an object of the user-defined class 

MyClass

 can be used in this call to 



Concat( )

:

result = String.Concat(mc, " current count is ",



                       MyClass.Count);

In this case, the string representation of 



mc

, which is of type 



MyClass

, is returned. By default, 

this is simply its class name. However, if you override the 

ToString( )

 method, then 



MyClass

can return a different string. For example, try adding this version of 



ToString( )

 to 


MyClass

in the preceding program:

public override string ToString() {

  return "An object of type MyClass";

}

When this version is used, the last line in the output will be



result: An object of type MyClass current count is 1

Searching a String

String

 offers many methods that allow you to search a string. For example, you can search 

for either a substring or a character. You can also search for the first or last occurrence of 

either.


www.freepdf-books.com


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   828   829   830   831   832   833   834   835   ...   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