String toLowerCase(); |
String greeting = "Hi World!";
greeting = greeting.toLowerCase();
// greeting <- "hi world!" |
String toUpperCase(); |
String greeting = "Hi World!";
greeting = greeting.toUpperCase();
// greeting <- "HI WORLD!" |
String trim(); |
String needsTrim = " trim me! ";
needsTrim = needsTrim.trim();
// needsTrim <- "trim me!" |
String substring(int beginIndex) |
String sample = "hamburger";
sample = sample.substring(3);
// sample <- "burger" |
String substring(int beginIndex, int endIndex) |
String sample = "hamburger";
sample = sample.substring(4, 8);
// sample <- "urge" |