All language subtitles for 13. Challenge Changing Casing in Text

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
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 Download
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

Original subtitles

0 Now, the last thing that I want to show you that you can do with strings is, you can use a method called 1

toUpperCase() 2

that changes all of the characters in your string to uppercase. 3

So as we have done before, we simply take the variable, and then we write a dot, and then we use toUpperCase 4

to turn every single character in the string to the uppercase version of it. 5

So let me show you what this looks like in real life. 6

So I have a variable that is called name and it contains the string Angela. 7

Now, if I write name.toUppercase, and then I add some empty parentheses, and finish off my statement 8

with a semi-colon, 9

and now if I hit command enter, you can see that in the console I get the string that's contained a name 10

printed out with every single character changed to the upper case. 11

Now at the moment this functionality is completed and then this data is lost. 12

So inside here, for example if I just wrote name, which is my variable, you can see that it's still lowercase. 13

So if you wanted this to be saved to this variable then all we need to do is say that name equals the 14

old version of name, which is this, changed to uppercase, and then reassigned to the same variable. 15

So now if I hit run and I type name into the console to try and pull up the value that’s contained inside 16

this variable, you can see it is now all capitalized. 17

Now we can change it in the other direction as well. 18

So, for example, if I wrote name now equals the previous version of name, which at this point is all 19

uppercase, .toLowerCase, then 20

now, the final version of name is actually all fully lowercase, 21

even the first a. It’s all been turned into lowercase. 22

Now that's pretty easy and it's pretty useful as well because sometimes you might want to ask the user 23

for, say, a prompt and you ask them for ‘What is your name?’. 24

And they end up giving you their name in, say, all lowercase, right? 25

And that doesn't really look very good when you print it out, say in an alert. 26

It doesn't look that great and it won't be consistent across different users. 27

Now if you've been watching along with the previous lessons and you've absorbed the knowledge then you 28

should now be able to use everything that you've learnt including how to slice strings up, how to concatenate 29

strings, and also how to change the casing in order to complete the next challenge. 30

So what I want you to do is to create a prompt that asks the user for their name, 31

but if they give you a name that is uppercase or lowercase, I want you to be able to send them an alert 32

that says Hello, 33

and then their name, so for example Angela, but the name has to be capitalized, but only for the first 34

character and none of the rest of the characters. 35

So I want you to think about this problem, 36

and break it down into smaller chunks that you can tackle one at a time. 37

Now, while there are much easier ways of doing it if you search Stack Overflow or Google, I want you 38

to only use the things that we've talked about in this module. 39

So everything that you need to complete this challenge is within the lessons of this module. 40

So pause the video now and see if you can complete this challenge.

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