Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to spilt the string with comma in jaav

String str = "dog, cat, bear, elephant, ..., giraffe";
List<String> elephantList = Arrays.asList(str.split(","));
//If you want to additionally get rid of whitespaces around items:
String[] elephantList = str.split("s*,s*");
Comment

PREVIOUS NEXT
Code Example
Java :: java show my form 
Java :: pdf intent does not have permission to launch 
Java :: android studio Toast usage 
Java :: string to char 
Java :: dowload htpasswd file java 
Java :: bulkwrite mongodb array of objects 
Java :: generate random number using math.random in java 
Java :: using java stream filter to find the sum of property 
Java :: convert pdf to word in java 
Java :: date and time java 
Java :: enhance for loop java 
Java :: how to merge two arrays in java 
Java :: reverse arraylist java recursion 
Java :: java session timeout 
Java :: how to create search function in android studio 
Java :: Java No-Arg Constructors 
Java :: convert stringbuffer to string in java 
Java :: jsoup remove element 
Java :: width and height of screen java 
Java :: share location in android programmatically 
Java :: java try...catch 
Java :: Simple For Loop Java Example 
Java :: firebase realtime database get key 
Java :: sort java array 
Java :: hash map java 
Java :: Java Remove Elements from HashSet 
Java :: limit decimals java 
Java :: streams in java 
Java :: position of an element in infinite sorted array 
Java :: how to get a set from a map in java 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =