Here you can find the source of split_fields(String str)
static String[] split_fields(String str)
//package com.java2s; import java.util.*; public class Main { static String[] split_fields(String str) { List list = new ArrayList(16); StringBuffer sb = new StringBuffer(); for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == '\t') { list.add(sb.toString()); sb = new StringBuffer(); } else { sb.append(c);/*from w w w . j a v a2s .com*/ } } list.add(sb.toString()); String[] lines = new String[list.size()]; Iterator it = list.iterator(); for (int i = 0; it.hasNext(); i++) { lines[i] = (String) it.next(); } return lines; } }