Professional IronPython


part into individual lines, you’d type



Download 20,35 Mb.
Pdf ko'rish
bet104/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   100   101   102   103   104   105   106   107   ...   453

part into individual lines, you’d type 
MyString.splitlines()
.


startswith()
: Performs the same task as 
endswith()
, except that this method works with 
the beginning of the string, rather than the end of the string. See the 
endswith()
entry in the 
list for details.


strip()
: Performs the same task as 
lstrip()
, except that this method removes spaces (or 
other characters) from both ends of the string, rather than just the left. See the 
lstrip()
entry in the list for details.


swapcase()
: Sets all of the lowercase characters to uppercase and all of the uppercase char-
acters to lowercase. For example, if you begin with ‘Hello World’, you’d receive ‘hELLO 
wORLD’ as output if you typed 
MyString.swapcase()
.


title()
: Returns a title-cased version of a string where the first letter of each word is capi-
talized and all other letters are lowercase. For example, if you begin with ‘helLo wORLD’, 
you’d receive ‘Hello World’ as output if you typed 
MyString.title()
.


translate(str table, [str deletechars])
 or 
translate(dict table)
: Replaces the 
characters in a string with the equivalents specified by 
table
. The 
table
argument is 256 
characters long and you can create it using the 
MakeTrans()
function found in the string 
module. (Remember to use 
from string import maketrans
to make accessing the func-
tion easy.) For example, if you want to replace the first 16 lowercase letters with hexadeci-
mal equivalents, you’d type 
MyString.translate(maketrans(‘abcdefghijklmnop‘, 
‘0123456789ABCDEF‘))
. Using this code as a starting point, ‘Hello World’ becomes
‘H4BBE WErB3’.



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   100   101   102   103   104   105   106   107   ...   453




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