trim() method remove the blank spaces from the left and right in the given string.
Here is the example how to remove blank spaces :
import java.lang.*;
public class StringTrim{
public static void main(String[] args) {
System.out.println("Source code of String Trim Method");
String str = " blankspaces ";
System.out.println("Entered String :" + str);
System.out.println("Output of the Program :" +str.trim());
}
}
The string Tuesday, May 27, 2008
Subscribe to:
Post Comments (Atom)
1 comments:
This site is very much useful for java begginers.....
Post a Comment