Previous Lecture Complete and continue  

  Practice Problem: Find the Character

Test Your Knowledge

Now that you know how to access individual characters in a string, let's find some characters. The table below contains different strings and the position of each character from the start of the string. For example, 'e' is the 2nd character in 'hello'. Find the character at each position in the string and log it to the console.

String Position
'programming rocks' 1st
'I went to the store' 8th
'westie' 3rd
'cookie' Last