Java String Split split(String text)

Here you can find the source of split(String text)

Description

split

License

LGPL

Declaration

public static List<String> split(String text) 

Method Source Code


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

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<String> split(String text) {
        List<String> parts = new ArrayList<>();

        if (text != null) {
            String[] split = text.split(",");
            for (String part : split) {
                parts.add(part.trim());/*w ww.  ja  v  a  2s.com*/
            }
        }

        return parts;
    }
}

Related

  1. split(String string)
  2. split(String string, String seperator)
  3. split(String strSource, String strReg)
  4. split(String text)
  5. split(String text)
  6. split(String text, String token)
  7. split(String token, String s)
  8. split(String toSplit)
  9. split(String value)