Skip to content

Characters in a string

Read · 1 of 3

A string is a row of chars

s.length() is how many characters there are (note the brackets: arrays use .length, strings use .length()).

s.charAt(i) is the character at position i, starting from 0. Single characters use single quotes: 'a'.