Tips for heathy life

Tips for heathy life

Kamis, 30 Oktober 2008

Delete characters WHITESPACE AND FROM THE FINAL any string in J2SE



I want to share how to Delete characters WHITESPACE AND FROM THE FINAL any string. You can use this code but if you copy this code and paste in your blog/website, please insert this link of article.

String str1=" Hello ";
String str2=" Java ";
System.out.println("Tanpa Trim : " + str1 + str2);
System.out.println("Dengan Trim : " + str1.trim() + str2.trim());

0 komentar:

Posting Komentar