Here you can find the source of csvList(String _text, Integer[] _idx_ret)
Parameter | Description |
---|---|
_text | a parameter |
_idx_ret | a parameter |
public static String[] csvList(String _text, Integer[] _idx_ret)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**// ww w . j a v a 2s . com * Kommaseparierte Werteliste in String[] umwandeln. * * Trennzeichen ist ',' * * @param _text * @param _idx_ret * @return */ public static String[] csvList(String _text, Integer[] _idx_ret) { List<String> list = new ArrayList<String>(); int idx = 0; boolean bCont = true; int idxr; do { idxr = _text.indexOf(',', idx); if (idxr == -1) { idxr = _text.length(); bCont = false; } list.add(_text.substring(idx, idxr).trim()); idx = idxr + 1; } while (bCont); _idx_ret[0] = (idxr + 1); String[] ret = new String[list.size()]; list.toArray(ret); return ret; } public static String substring(String _text, int _idx) { if (_idx >= 0) { if (_idx < _text.length()) { return _text.substring(_idx); } } return ""; } }