Common String Practices
Joining Two Strings
// Using the operator
String first = "Mr. ";
String last = "Park";
String full_name = first + last;
System.out.println(full_name); // Outputs: Mr. Park
// Using the method
String a = "Hello";
String b = a.concat(" World!");
System.out.println(b); // Outputs: Hello World!Get Individual Characters from a String
Determine the number of characters in a String
Check a String's prefix or suffix
Replace a certain pattern in a String
Using a Loop on a String
Last updated