Horje
String .trim() method in java Code Example
String .trim() method in java
// Java program to demonstrate working
// of java string trim() method
 
class Gfg {
 
    // driver code
    public static void main(String args[])
    {
 
        // trims the trailing and leading spaces
        String s = " geeks for geeks has all java functions to read  ";
        System.out.println(s.trim());
 
        // trims the leading spaces
        s = " Chetna loves reading books";
        System.out.println(s.trim());
    }
}




Java

Related
random int between two values Code Example random int between two values Code Example
Resource leak: 'scanner' is never closed Code Example Resource leak: 'scanner' is never closed Code Example
change fab image programatically Code Example change fab image programatically Code Example
Delete end element in string java Code Example Delete end element in string java Code Example
android java shared preferences remove key Code Example android java shared preferences remove key Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11