String s; String s1 = "Hello"; String s2 = new String("World");
boolean b = "World".equals("World"); \\ vale trueStringhe sono oggetti. Per verificare l'uguaglianza non usare il ==.
String s3= s1 + " " + s2; \\ vale "Hello World"
String s = "World"; int x = s.length(); \\ vale 5
String s = "Hello World"; char x = s.charAt(4); \\ vale 'oGli indice iniziano a 0.
Metodo: indexOf()
String s = "Hello World"; int x = s.index("World"); \\ vale 6
Metodo: substring()
String s = "Hello World"; String s1 = s.substring(6,11); \\ vale "World"