dcsimg

How do I get the length of a String?

John Zukowski

The String class provides a length() method that returns the length of that String:

// This sets length to 7
int length = "The End".length();