public static String join( String token, String[] strings )
{
StringBuffer sb = new StringBuffer();
for( int x = 0; x < ( strings.length - 1 ); x++ )
{
sb.append( strings[x] );
sb.append( token );
}
sb.append( strings[ strings.length - 1 ] );
return( sb.toString() );
}
for guys who have an old JDK, the split function doesn't exist prior to jdk1.3. The alternative is the following, using the StringTokenizer class
instead of
String line_fields[]=line_data.split("\\t");
use
StringTokenizer line_fields = new StringTokenizer(line_data,"\t");
reference:
the enhancement require to sun
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5015163
No comments:
Post a Comment