Read the API for String, in particular the length() method.