Java tutorial
/* 13) Strip whitespace >>>ABCD */ import org.apache.commons.lang.StringUtils; public class StringUtilsTrial { 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 ")); } }