Here you can find the source of transformIntoAList(String... elements)
Parameter | Description |
---|
public static List<String> transformIntoAList(String... elements)
//package com.java2s; /******************************************************************************* * Copyright (c) 2016 Logimethods//w w w . jav a 2s.c om * All rights reserved. This program and the accompanying materials * are made available under the terms of the MIT License (MIT) * which accompanies this distribution, and is available at * http://opensource.org/licenses/MIT *******************************************************************************/ import java.util.ArrayList; import java.util.List; public class Main { /** * @param elements, a undefined number of String(s) * @return a list of all of those Strings */ public static List<String> transformIntoAList(String... elements) { ArrayList<String> list = new ArrayList<String>(elements.length); for (String element : elements) { list.add(element.trim()); } return list; } }