Java 11 Development Features Part 1 - String strip() method
Development Java 11 Features
1. New String Methods
isBlank, lines, strip, stripLeading, stripTrailing, and repeat
2. New File Methods
3. Collection to an Array
4. The Not Predicate Method
5. Local-Variable Syntax for Lambda
6. HTTP Client
7. Nest Based Access Control
8. Running Java Files
Returns a string whose value is this string, with all leading and trailing white space removed.
If this String object represents an empty string, or if all code points in this string are white space, then an empty string is returned.
Otherwise, returns a substring of this string beginning with the first code point that is not a white space up to and including the last code point that is not a white space.
This method may be used to strip white space from the beginning and end of a string.
Returns:
a string whose value is this string, with all leading and trailing white space removed
Since:
11
See Also:
Character.isWhitespace(int)
public String strip() {
String ret = isLatin1() ? StringLatin1.strip(value)
: StringUTF16.strip(value);
return ret == null ? this : ret;
}
Watch video Java 11 Development Features Part 1 - String strip() method online, duration hours minute second in high quality that is uploaded to the channel CodeWis Technologies by Nuhman Paramban 09 December 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 47 times and liked it 0 visitors.