All language subtitles for 12. Accessing Characters and Slices in Strings

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian Download
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 0 1 00:00:00,630 --> 00:00:05,930 To your surprise or not strings also have an indexing system. 1 2 00:00:05,940 --> 00:00:11,880 The good news is that they have exactly the same system as lists so they have positive and negative 2 3 00:00:11,880 --> 00:00:17,060 indexing and you can slice them and you can access items from them. 3 4 00:00:17,110 --> 00:00:28,530 Let me make a quick demonstration, string 'hello', that will give you the string 'e' which is still a string, 'hello' 4 5 00:00:28,550 --> 00:00:38,340 is a strin, 'e' is also a string, negative indexing, and also slicing. One cool thing you can do is let me get 5 6 00:00:38,370 --> 00:00:39,530 this list. 6 7 00:00:39,660 --> 00:00:49,210 So it's a list containing different types of objects and what you can do is you can access, guess it. 7 8 00:00:49,840 --> 00:00:51,320 Well that's the 'hello' string. 8 9 00:00:51,370 --> 00:00:59,500 So, the first item of the list and then you can use a chain indexing such as for example if you type 9 10 00:00:59,560 --> 00:01:00,490 2 there. 10 11 00:01:00,610 --> 00:01:02,800 Guess what you're going to get? 11 12 00:01:02,980 --> 00:01:14,080 Well, you're going to get the first L because of that has an index of 2, so 0 for H, 1 for E, 2 for L because 12 13 00:01:14,100 --> 00:01:17,660 this part here is the value on its own. 13 14 00:01:17,870 --> 00:01:25,180 And this other part will get that item with index 2 of that value which happens to be a string. 14 15 00:01:25,250 --> 00:01:26,750 It is as simple as that. 1627

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.