Java String Split split(String s, String at)

Here you can find the source of split(String s, String at)

Description

split

License

Open Source License

Declaration

static String[] split(String s, String at) 

Method Source Code

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

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

public class Main {
    static String[] split(String s, String at) {
        List<String> result = new ArrayList<String>();
        int i, last = 0;
        while ((i = s.indexOf(at, last)) != -1) {
            result.add(s.substring(last, i));
            last = i + at.length();/* www .j  av a 2 s .  c  om*/
        }
        result.add(s.substring(last));
        return result.toArray(new String[0]);
    }
}

Related

  1. split(String s)
  2. split(String s)
  3. split(String s)
  4. split(String s)
  5. split(String s, int c)
  6. split(String s, String s1)
  7. split(String s, String seperator)
  8. split(String s, String spliter, boolean removeEmptyItem)
  9. split(String s, String splitStr)