Strip

Java-Strip

Strip The strip( ) method of String is used to remove the leading and trailing white spaces in the string . For example: StripLeading The stripLeading( ) method of String is used to remove the leading white spaces in the string. For example: StripTrailing The stripTrailing( ) method of String is used to remove the trailing white … Read more…

Split

Java-Split

Split The split() method of String is used to split the string around matches of the given regular expression. It has the following form: The array returned by this method contains each substring of this string that is terminated by another substring that matches the given expression or is terminated by the end of the string. … Read more…

Adjust Indentation

Java-Adjust Indentation

Adjust Indentation The intent( ) method of Stirng is used to adjust the indentation of each line of this string based on the specified value, and normalizes line termination characters. If value is 5 then 5 spaces (U+0020) are inserted at the beginning of each line. For example: If value is -5 then up to … Read more…

Case Conversions

Java-Case Conversions

Case Conversions As the Java language is case sensitive, it differentiates uppercase letters from lowercase letters. The String class provides two methods, namely toLowerCase( ) and toUpperCase( ) to facilitate case conversions. While the toLowerCase( ) method converts all the letters of the given string to lower case, the toUpperCase( ) method does just the … Read more…