Mega Code Archive

 
Categories / Java Tutorial / Apache Common
 

StringUtils stripToEmpty

import org.apache.commons.lang.StringUtils; public class MainClass {     public static void main(String[] args) {       //Strip whitespace from start and end of the string.       //If null returns empty string       System.out.println("13) Strip whitespace >>>" +           StringUtils.stripToEmpty("     ABCD      "));     } } 13) Strip whitespace ABCD