public static String [ ] toStringArray ( String pString , String pDelimiters ) { if ( isEmpty ( pString ) ) { return new String [ 0 ] ; } StringTokenIterator st = new StringTokenIterator ( pString , pDelimiters ) ; List < String > v = new ArrayList < String > ( ) ; while ( st . hasMoreElements ( ) ) { v . add ( st . nextToken ( ) ) ; } return v . toArray ( new String [ v . size ( ) ] ) ; }
Converts a delimiter separated String to an array of Strings .