Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.util.ArrayList;

import java.util.List;
import java.util.StringTokenizer;

public class Main {
    public static String[] split(String str, String delimiters) {
        final StringTokenizer st = new StringTokenizer(str, delimiters);
        final List<String> tokens = new ArrayList<String>();
        while (st.hasMoreTokens()) {
            final String token = st.nextToken();
            tokens.add(token);
        }
        return tokens.toArray(new String[tokens.size()]);
    }
}