Java String split() method

Java String split() method split current String against given regular expression and returns a char array. Syntax: public String split(String regex)                 public String split(String regex, int limit) 1234  public String split(String...

Java String replaceAll() method

Java String replaceAll() method returns a String replacing all the sequence of characters matching regular expression i.e regex and replacement string. Syntax: public String replaceAll(String regex, String replacement) 123  public String replaceAll(String regex,...

Java String replace() method

Java String replace() method returns new String by replacing old characters with new characters or old CharSequence to new CharSequence. Syntax: public String replace(char oldChar, char newChar) public String replace(CharSequence target, CharSequence replacement) 1234...

Java String length() method

Java String length() method returns length of the characters in a String. Syntax: public int length() 123  public int length()  Returns It returns length of the characters Java String length() method example 1          public class JavaStringLengthEx1     { ...

Java String lastIndexOf() method

Java String lastIndexOf() method returns last index of character or substring in a String. Syntax:                       Method                                                  Description int lastIndexOf(int ch) It returns last index position for the given char value...

Java String join() method

Java String join() method returns a joined String with given delimiter Syntax: public static String join(CharSequence delimeter,charSequence...elements) public static String join(CharSequence delimeter,Iterable<?extens charSequence>elements) 1234  public...

Java String isEmpty() method

Java String isEmpty() method checks whether current String is empty or not. Syntax: public boolean isEmpty() 123  public boolean isEmpty()  Returns  It returns true, if length of String is 0 otherwise false. Java String isEmpty() method example 1      public...

Pin It on Pinterest