public static String[] splitString(String source,char delimeter){
  String[] resultArray=null;
  int delimeterIndex=source.indexOf(delimeter);
  if (delimeterIndex < 0) {
    resultArray=new String[1];
    resultArray[0]=source;
  }
 else {
    String firstStr=source.substring(0,delimeterIndex);
    String secondStr=source.substring(delimeterIndex + 1);
    resultArray=new String[2];
    resultArray[0]=firstStr;
    resultArray[1]=secondStr;
  }
  return resultArray;
}

public static String [ ] splitString ( String source , char delimeter ) { String [ ] resultArray = null ; int delimeterIndex = source . indexOf ( delimeter ) ; if ( delimeterIndex < 0 ) { resultArray = new String [ 1 ] ; resultArray [ 0 ] = source ; } else { String firstStr = source . substring ( 0 , delimeterIndex ) ; String secondStr = source . substring ( delimeterIndex + 1 ) ; resultArray = new String [ 2 ] ; resultArray [ 0 ] = firstStr ; resultArray [ 1 ] = secondStr ; } return resultArray ; }
returns pair of string objects ( packed in as string array ) that are deparated by one delimeter character in passed source string object . if delimeter is not found array with one source string object is returned .
