toUpperCase use the current default locale, or you can pass a specific locale as an argument:
public StringtoLowerCase()
Returns a String with each character converted to its lowercase equivalent
if it has one according to the default locale.
public StringtoUpperCase()
Returns a String with each character converted to its uppercase equivalent
if it has one according to the default locale.
public StringtoLowerCase(Locale loc)
Returns a String with each character converted to its lowercase equivalent
if it has one according to the specified locale.
public StringtoUpperCase(Locale loc)
Returns a String with each character converted to its uppercase equivalent
if it has one according to the specified locale.
The concat method returns a new string that is equivalent to the string returned when you use + on two
strings. The following two statements are equivalent:
newStr = oldStr.concat(" not");
newStr = oldStr + " not";
Exercise 13.3: As shown, the delimitedString method assumes only one such string per input string.
Write a version that will pull out all the delimited strings and return an array.
Exercise 13.4: Write a program to read an input string with lines of the form "type value", where type is
one of the wrapper class names (Boolean, Character, and so on) and value is a string that the type's
constructor can decode. For each such entry, create an object of that type with that value and add it to an
ArrayListsee "ArrayList" on page 582. Display the final result when all the lines have been read. Assume
a line is ended simply by the newline character '\n'.
13.2.5. String Conversions
You often need to convert strings to and from something else, such as integers or booleans. The convention is
that the type being converted to has the method that does the conversion. For example, converting from a
String to an int requires a static method in class Integer. This table shows all the types that you can
convert, and how to convert each to and from a String:
Type To String From String
boolean String.valueOf(boolean) Boolean.parseBoolean(String)
byte String.valueOf(int) Byte.parseByte(String, int base)
char String.valueOf(char) str.charAt(0)
short String.valueOf(int) Short.parseShort(String, int base)