Java List Split split(final String line, final char delimiter, final List parts)

Here you can find the source of split(final String line, final char delimiter, final List parts)

Description

split

License

Apache License

Declaration

public static void split(final String line, final char delimiter, final List<String> parts) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    public static void split(final String line, final char delimiter, final List<String> parts) {
        parts.clear();/*from   ww  w.ja v  a  2s. c o  m*/
        int start = 0;
        while (start <= line.length()) {
            int end = line.indexOf(delimiter, start);
            if (end < 0) {
                end = line.length();
                parts.add(line.substring(start));
            } else {
                parts.add(line.substring(start, end));
            }
            start = end + 1;
        }
    }
}

Related

  1. split(final List list, final int count)
  2. split(final List list, final int index)
  3. split(final List orginalList, final int splitSize)
  4. split(final List original, final int maxListSize, final Class listImplementation)
  5. split(List data, int max)
  6. split(List list)
  7. split(List list, String separator)
  8. split(List list, String separator)