stringmethods


 * These string methods will be on the AP exam for computer science.

To create a string:** String hotJapanese = newString("oguri-shun"); String hotJapanese = "oguri-shun";
 * you can also create this by typing:**


 * Strings are, technically, like a class. They are an array of single letters.**

hotJapanese.compareTo(rocklee); if hotJapanese was compared to a word that comes before "oguri-shun" alphabetically, then it would return a positive number.**
 * this compares "oguri-shun" and "rocklee" alphabetically. It returns a negative number because "o" comes before "r" in the alphabet

hotJapanese.indexOf(shun); **This returns the slot in the array where the first letter (in this case, "s") is being searched for. This would have returned 6.**

hotJapanese.length; **This gives the length of the array. It would return 10 in this case.**

hotJapanese.substring(6); hotJapanese.substring(2, 6); In this case it would return:** uri-**. Notice it does //not// return: //ori-s// because it stops at the fifth slot.
 * This returns the string starting at the index and goes all the way to the end. In this case it would return:** shun**.**
 * This returns the string starting at the first number in the parenthesis and ends the number //before// the last number in the parenthesis.