Take a look at the API - it has all java SE classes, their methods and available variables.
String (Java Platform SE 6)
There are a number of methods you could use to implement the provided...