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 android.text.TextUtils;

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

public class Main {

    public static List<String> toStringList(String itemsstring) {
        List<String> resultList = new ArrayList<String>();
        if (TextUtils.isEmpty(itemsstring))
            return resultList;
        if (itemsstring.startsWith(",") && itemsstring.endsWith(",")) {
            itemsstring = itemsstring.substring(1, itemsstring.length() - 1);
        }
        String[] split = itemsstring.split(",");
        return Arrays.asList(split);
    }
}