public static String trim ( String value , String toTrim ) { int len = toTrim . length ( ) ; while ( value . startsWith ( toTrim ) ) { value = value . substring ( len ) ; } while ( value . endsWith ( toTrim ) ) { value = value . substring ( 0 , value . length ( ) - len ) ; } return value ; }
Trims the given string from the given value