I have a line like this string strings=" black door,white door,red door "
Now I want to put this string in an array.
I use split myarray = strings.split(',') , then the array looks like this: black,door,white,door,red,door.
I want to put a string in an array after each occurrence of a comma out of space. I want it to be in an array: black door,white door,red door.
source share