You access individual characters using square brackets and an index: string word = "hello"; char first = word[0]; This gets the first character 'h'. String indices start at 0, just like arrays.
The last character sits at index length() - 1. For "hello" with length 5, the last character is word[4] which is 'o'. The indices run from 0 to length() - 1. Going outside this range causes undefined behavior.
You can use indices in loops to process each character. A for loop from 0 to word.length() - 1 visits every character. This lets you examine or modify the string one letter at a time.