Java Comma Separated List commaSepLineToList(String commSepLine)

Here you can find the source of commaSepLineToList(String commSepLine)

Description

Comma sep line to list.

License

Open Source License

Parameter

Parameter Description
commSepLine the comm sep line

Return

the list

Declaration

public static List<String> commaSepLineToList(String commSepLine) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006-2010 eBay Inc. All Rights Reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *******************************************************************************/

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

public class Main {
    /**//from ww w  . j a  v a2 s  . c  om
     * Comma sep line to list.
     *
     * @param commSepLine the comm sep line
     * @return the list
     */
    public static List<String> commaSepLineToList(String commSepLine) {
        List<String> retList = null;
        if (commSepLine != null) {
            String[] calls = commSepLine.split(",");
            if (calls != null) {
                retList = new ArrayList<String>();
                for (String call : calls) {
                    retList.add(call.trim());
                }
            }

        }
        return retList;
    }
}

Related

  1. commaSeparatedString(List items)
  2. commaSeparatedString(List strings)
  3. commaSeparatedStringToList(String csvListStr)
  4. commaSeparatedToList(String str)
  5. commaSeperatedStringToList(String strValue)
  6. commaStringToList(String inputString)
  7. convertCommaDelimitedStringToList(String s)
  8. ConvertDiscussionGroupListToCommaString( List list)
  9. convertToStringList(String valuesCommaSeparated)