private String truncateAt ( final String input , final String searchString ) { final int i = input . indexOf ( searchString ) ; if ( i != - 1 ) { return input . substring ( 0 , i ) ; } return input ; }
Truncate the input string after the first occurrence of the searchString .