In my website I have a textbox that allow user to enter a group of numbers like this:
(118,38,137,15,156,14,157,36,152,49,142,57)
How can I store these numbers in an array like the following?:
[118 38 137 15 156 14 157 36 152 49 142 57]
Use the
Splitmethod:The
Splitmethod has several overloads, depending on purpose. I’ve chosen the simplest here, that only takes a singleCharacterargument, in this case","c, a comma.