stripTrailing() method of String class

stripTrailing() method has been introduced in String class of Java 11. It is used to remove all the trailing white space characters from the string and return the remaining string. It means it removes white spaces that come at the end of string. If the string only contains the white spaces then an empty string is returned. Let us … Read more

strip() method in String class

In Java 11 a new method strip() has been introduced in String class. It is used to remove all the trailing and leading white space characters from the string. strip() method returns the string after removing these white spaces. If the string only consists of white spaces then an empty string is returned. Let us … Read more

isDigit in Java

isDigit is a static method of Character class. It is used to determine whether a character is a digit or not. If the character is digit then isDigit return true otherwise it return false. Let us look at an example code : Output

Escape Sequence in Java

Escape sequence is a character which is preceded by the backslash (\). Compiler has special meaning for escape sequences. Use of Escape Sequences Sometimes we may need to print some text within double quotes or we may need insert a new line in between texts. So these escape sequences were introduced to perform these special … Read more