public static String splitSafe(String string,String separator,int index){
  if (string == null) {
    return null;
  }
  String[] split=string.split(separator);
  if (index >= 0 && split.length > index && split[index] != null) {
    return String.valueOf(split[index]);
  }
  return null;
}

public static String splitSafe ( String string , String separator , int index ) { if ( string == null ) { return null ; } String [ ] split = string . split ( separator ) ; if ( index >= 0 && split . length > index && split [ index ] != null ) { return String . valueOf ( split [ index ] ) ; } return null ; }
gets the string at the given index of the array produced by splitting the given string on the given separator . returns null if the given string is null or if the given index is out of bounds of the array .
