@Deprecated public static String megastrip(String str,boolean left,boolean right,String what){
  if (str == null) {
    return null;
  }
  int limitLeft=0;
  int limitRight=str.length() - 1;
  while (left && limitLeft <= limitRight && what.indexOf(str.charAt(limitLeft)) >= 0) {
    limitLeft++;
  }
  while (right && limitRight >= limitLeft && what.indexOf(str.charAt(limitRight)) >= 0) {
    limitRight--;
  }
  return str.substring(limitLeft,limitRight + 1);
}

@ Deprecated public static String megastrip ( String str , boolean left , boolean right , String what ) { if ( str == null ) { return null ; } int limitLeft = 0 ; int limitRight = str . length ( ) - 1 ; while ( left && limitLeft <= limitRight && what . indexOf ( str . charAt ( limitLeft ) ) >= 0 ) { limitLeft ++ ; } while ( right && limitRight >= limitLeft && what . indexOf ( str . charAt ( limitRight ) ) >= 0 ) { limitRight -- ; } return str . substring ( limitLeft , limitRight + 1 ) ; }
this is a both way strip
