Professional Documents
Culture Documents
String Buffer
Jim Burns
Manipulating Characters
We
toUpperCase(),
isLowerCase(), toLowerCase(), isDigit(),
isLetter(), isLetterOrDigit(), isWhitespace()
Methods that begin with is perform tests
delivering true or false values
Methods that begin with to perform
conversions
the constructor
String aGreeting = new String(Hello);
Without
the constructor
String aGreeting = Hello;
Unlike
compareTo() method
Returns an integer that is the numeric
difference between the first two nonmatching characters
Concatenation
You
Concatenationnumbers to strings
by using +
The
following is permissible:
Int myAge = 25;
String aString = My age is + myAge;
Another example would be
String anotherString;
float someFloat = 12.34f;
anotherString = + someFloat;
eventString = new
StringBuffer(Hello there);
Cannot use StringBuffer eventString = Hello
there;
Can