- String s = "Good";
- String ss = {'A', 'B', 'C'};
- char[] c = {'L', 'u', 'c', 'k'};
- String sss = new String(c);
\n = newline, \t = tab, \\ = escape character itself, \" = double quote \' = single quote
- boolean b = s.equals("good"); // b = false
- b = s.equalsIgnoreCase("good"); // b = true
- int i = s.length(); // i = 4
- i = s.indexOf('o'); // i = 1
- i = s.LastIndexOf('o'); // i = 2
- i =s.indexOf("od"); // i = 2
- String t = s.substring(2); // t = "od"
- t = s.substring(0,2); // t = "Go"
- t = s.concat(sss); // t = "GoodLuck"
System.out.println( "This is useful if you need " + "to enter very long strings, but you do not " + "want your input file to have long strings");
char charAt(int index),
int compareTo(String s),
static String copyValueOf(char[] c),
boolean endsWith(String s),
boolean startsWith(String s, int offset),
byte[] getBytes(String s),
int hashCode(),
String replace(char oldc, char newc),
String toUpperCase()/toLowerCase(),
String trim(), (remove white spaces from both ends)
static String valueof(boolean b), ("true"/"false")
static String valueof(double d), (String rep of d)