public String removeAfter(String original,String marker){
  int index=original.indexOf(marker);
  if (index != -1) {
    return original.substring(0,index);
  }
  return original;
}

public String removeAfter ( String original , String marker ) { int index = original . indexOf ( marker ) ; if ( index != - 1 ) { return original . substring ( 0 , index ) ; } return original ; }
this method removes the end part of a string beginning at a specified marker .
