list - Adding new line delimitter instead of Comma between Elements except the First Element in java -
i want add new line delimitter between elements of list in java comma delimitted, how can able achieve this? eg: if list [arol, jacob, joseph]
can able achieve similay
[ arol jacob joseph ]
using power of java 8 can join:
list<string> myist = arrays.aslist("arol", "jacob", "joseph"); string result = string.join("\n", myist); system.out.println(result);
the result
arol jacob joseph
Comments
Post a Comment