StringUtils: chomp(String str, String separator)
/*
3) Chomp END >>>A test String
*/
import org.apache.commons.lang.StringUtils;
public class StringUtilsTrial {
public static void main(String[] args) {
// Remove the specified string at the end of String
System.out.println("3) Chomp END >>>" + StringUtils.chomp("A test String END", "END"));
}
}
Apache-Common-Lang.zip( 248 k)Related examples in the same category