String in Java Archive
Description: This method returns a new string resulting from replacing all occurrences of oldChar in this string with newChar. Syntax: Here is the syntax of this method: public String replace(char oldChar, char newChar) Parameters: Here …
Description: This method has two variants which can be used to test if two string regions are equal. Syntax: Here is the syntax of this method: public boolean regionMatches(int toffset, String other, int ooffset, int …
Description: This method tells whether or not this string matches the given regular expression. An invocation of this method of the form str.matches(regex) yields exactly the same result as the expression Pattern.matches(regex, str). Syntax: Here …
Description: This method returns the length of this string. The length is equal to the number of 16-bit Unicode characters in the string. Syntax: Here is the syntax of this method: public int length() Parameters: …
Description: This method has following variants: int lastIndexOf(int ch): Returns the index within this string of the last occurrence of the specified character or -1 if the character does not occur. public int lastIndexOf(int ch, …
Description: This method returns a canonical representation for the string object. It follows that for any two strings s and t, s.intern() == t.intern() is true if and only if s.equals(t) is true. Syntax: Here …
Description: This method has following different variants: public int indexOf(int ch): Returns the index within this string of the first occurrence of the specified character or -1 if the character does not occur. public int …