Useful String functions and more
Java
StringBuilder
StringBuilderStringBuilder str = new StringBuilder();
str.append("Hello");
str.append("World");
System.out.println(str.toString());HelloWorldequals()
equals()syntax
public boolean equals(Object anotherObject)example
String myStr1 = "Hello";
String myStr2 = "World";
System.out.println("Hello".toLowerCase().equals("hello")); // Returns true
System.out.println(myStr1.equals(myStr2)); //Returns falsecompareTO()
compareTO()join()
join()split()
split()more useful functions
Last updated
Was this helpful?