java tutorial - Java strings trim() method - java programming - learn java - java basics - java for beginners
Learn Java - Java tutorial - Java strings trim - Java examples - Java programs
Description
The trim () method — returns a copy of the line with missing leading and trailing spaces, in other words, the method allows in Java to remove spaces at the beginning and end of the line.
Syntax
Syntax of this method:
Options
Detailed information about the parameters:
- No.
Return value
- In Java, trim () returns a copy of this line, in which the leading and trailing spaces are removed, or this line if it does not have leading or trailing spaces.