Java tutorial
//package com.java2s; import java.util.*; public class Main { public static Vector createFieldList(String strFieldList, String strSeparator) { // Build field list Vector vtFieldList = new Vector(); String strFieldName; int iIndex = 0; int iLastIndex = iIndex; while ((iIndex = strFieldList.indexOf(strSeparator, iLastIndex)) >= 0) { strFieldName = strFieldList.substring(iLastIndex, iIndex); vtFieldList.add(strFieldName); iLastIndex = iIndex + 1; } strFieldName = strFieldList.substring(iLastIndex, strFieldList.length()); vtFieldList.add(strFieldName); return vtFieldList; } }