private static int findSeparator(String s){
  int result=s.indexOf('-');
  if (result == -1) {
    result=s.indexOf(',');
  }
  if (result == -1) {
    result=s.indexOf(' ');
  }
  if (result == -1) {
    result=s.indexOf('.');
  }
  return result;
}

private static int findSeparator ( String s ) { int result = s . indexOf ( '-' ) ; if ( result == - 1 ) { result = s . indexOf ( ',' ) ; } if ( result == - 1 ) { result = s . indexOf ( ' ' ) ; } if ( result == - 1 ) { result = s . indexOf ( '.' ) ; } return result ; }
finds the first occurrence of ' - ' , or if that character is not found , the first occurrence of ' , ' , or the first occurrence of ' ' or ' . '
