Java String Split split_str(String input, String split)

Here you can find the source of split_str(String input, String split)

Description

splistr

License

Open Source License

Declaration

public static final List<String> split_str(String input, String split) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.List;
import java.util.ArrayList;

public class Main {

    public static final List<String> split_str(String input, String split) {
        List<String> result = new ArrayList<String>();
        int index = input.indexOf(split);
        int beg = 0;
        while (index != -1) {
            String str = input.substring(beg, index);
            beg = index + 1;/*from   ww  w . j av  a 2  s .c om*/
            result.add(str);
            index = input.indexOf(split, beg);
        }
        if (index == -1) {
            String str = input.substring(beg);
            result.add(str);
        }
        return result;
    }
}

Related

  1. split(String token, String s)
  2. split(String toSplit)
  3. split(String value)
  4. split(String value)
  5. split_fields(String str)
  6. splitAndTrim(String str)
  7. splitAndTrim(String str, String splitBy)
  8. splitAndUnEscape(String str)
  9. splitArgs(String args, int expectedArgs)