For simple array members like that, you can use JSON.parse.

var array = JSON.parse("[" + string + "]");

This gives you an Array of numbers.

[0, 1]

If you use .split(), you'll end up with an Array of strings.

["0", "1"]

Just be aware that JSON.parse will limit you to the supported data types. If you need values like undefined or functions, you'd need to use eval(), or a JavaScript parser.


If you want to use .split(), but you also want an Array of Numbers, you could use Array.prototype.map, though you'd need to shim it for IE8 and lower or just write a traditional loop.

var array = string.split(",").map(Number);
Answer from I Hate Lazy on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ string-to-array-in-javascript
JavaScript - Convert String to Array - GeeksforGeeks
August 5, 2025 - The Array.from() method can convert a string into an array of characters. This method is especially useful if you want to create an array from an iterable object, like a string, without needing to specify a separator.
๐ŸŒ
W3Schools
w3schools.com โ€บ java โ€บ java_howto_string_to_array.asp
Java How To Convert a String to an Array
Explanation: The method toCharArray() turns the string into an array of characters.
Discussions

Converting a String to an Array
๐ŸŒ r/godot
4
6
October 24, 2023
string to string array conversion in java - Stack Overflow
I have a string = "name"; I want to convert into a string array. How do I do it? Is there any java built in function? Manually I can do it but I'm searching for a java built in function. I want an... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Is there a way to convert an array into string like ["P" ,"A","N","D","A"] to PANDA ?
["P" ,"A","N","D","A"].join('') you can pass a string to join, to change the default behavior (which is joining with a comma). If you use an empty string you join the letters without additional characters. More on reddit.com
๐ŸŒ r/learnjavascript
26
47
January 4, 2022
String to a char array
The straightforward solution to your question is to collect the characters into a vector like this: let letters: Vec = my_string.chars().collect(); From there, it's possible to convert the Vec into an array using try_into(). let array_of_chars: [char; 42] = letters.try_into()?; However, I'm curious what you plan to do with this array of characters. The reason there is no easy way to index into a string and get just one character is that once you go outside the realm of ASCII, strings become a lot more nuanced and treating them as an "array of characters" is almost always incorrect. Tom Scott has a wonderful rant on YouTube about Unicode and how UTF-8 is actually a giant hack, which might explain in more detail why "array of chars" is the wrong way of thinking about strings. More on reddit.com
๐ŸŒ r/rust
23
14
April 2, 2022
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ string-to-array-in-java-how-to-convert-a-string-to-an-array-in-java
String to Array in Java โ€“ How to Convert Strings to Arrays
July 6, 2023 - Iterate over the charArray using a for-each loop to print each character individually. ... H e l l o , W o r l d ! ... Simplicity: The toCharArray() method provides a straightforward way to convert a string to a character array with just a single ...
๐ŸŒ
arrayThis
arraythis.com
Online array converter; convert your text list to array | arrayThis
Instantly convert your text list to array using arrayThis online tool; valid arrays for JS, PHP, PERL, Python and much more.
๐ŸŒ
DEV Community
dev.to โ€บ sanchithasr โ€บ 6-ways-to-convert-a-string-to-an-array-in-javascript-1cjg
6 Ways to Convert a String to an Array in JavaScript - DEV Community
September 24, 2022 - Converting from string to array is always done using the split() method but after ES6, there are many tools we could do the same.
๐ŸŒ
Board Infinity
boardinfinity.com โ€บ blog โ€บ string-to-array-conversion-in-javascript
String to Array conversion in JavaScript | Board Infinity
June 13, 2026 - There is just a single method that is quite famous and widely used in JavaScript for turning a String into an array in JS and that is the .split() method. This method divides a string into an array of other strings, using a particular character, ...
Find elsewhere
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ convert string to array in java
Convert String to Array in Java
April 19, 2024 - Create a character array that is the same length as the string. ... Return or perform the operation on the character array. ... To convert a string to a char array, we can use the toCharArray() function.
๐ŸŒ
Simplilearn
simplilearn.com โ€บ home โ€บ resources โ€บ software development โ€บ converting string to array in php using different methods
Converting String to Array in PHP Using Different Methods
September 17, 2025 - Understand the need to convert string to array in PHP and explore the complete list of methods used to convert a string to an array in PHP. Start learning now!
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ python-string-to-array-how-to-convert-text-to-a-list
Python String to Array โ€“ How to Convert Text to a List
February 21, 2022 - The most straightforward way is to type cast the string into a list. Tyepcasting means to directly convert from one data type to another โ€“ in this case from the string data type to the list data type.
๐ŸŒ
airbrake
docs.airbrake.io โ€บ home โ€บ blog โ€บ javascript error handling โ€บ javascript: how to convert a string into an array
JavaScript: How To Convert a String Into an Array - Airbrake Docs
January 19, 2022 - The split() method is the most popular way to do this. The split() method is one of the most popular ways JavaScript developers convert their strings into arrays.
๐ŸŒ
SamanthaMing
samanthaming.com โ€บ tidbits โ€บ 83-4-ways-to-convert-string-to-character-array
4 Ways to Convert String to Character Array in JavaScript | SamanthaMing.com
Here are 4 ways to split a word into an array of characters. "Split" is the most common and more robust way. But with the addition of ES6, there are more tools in the JS arsenal to play with ๐Ÿงฐ ยท I always like to see all the possible ways to solve something because then you can choose the best way for your use case. Also, when you see it pop up in someone's codebase, you will understand it with ease ๐Ÿ‘โ€ฌ ยท const string = 'word'; // Option 1 string.split(''); // Option 2 [...string]; // Option 3 Array.from(string); // Option 4 Object.assign([], string); // Result: // ['w', 'o', 'r', 'd']
๐ŸŒ
ReqBin
reqbin.com โ€บ code โ€บ javascript โ€บ jaarxzpl โ€บ javascript-string-to-array-example
How do I convert string to array in JavaScript?
March 9, 2023 - The array.from() method and the spread ("...") operator convert a string into an array of characters. In this JavaScript String to Array conversion example, we use the string.split() method to convert a string into an array of strings.
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java string โ€บ convert string to string array
Convert String to String Array | Baeldung
January 8, 2024 - Simply put, converting a string to a singleton array is pretty straightforward. If we need to break the given string into segments, we can turn to the String.split() method.
๐ŸŒ
DEV Community
dev.to โ€บ mehmehmehlol โ€บ from-string-to-array-to-string-f67
From String to Array to String - DEV Community
April 23, 2021 - But you know, at least we know Array.from() is one of the possible ways to convert string to array!
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ string-to-array-java
How to Convert String to Array in Java | DigitalOcean
August 4, 2022 - From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
๐ŸŒ
Reddit
reddit.com โ€บ r/godot โ€บ converting a string to an array
r/godot on Reddit: Converting a String to an Array
October 24, 2023 -

I have a string that is something like ["Value1","Value2","Value3"]. I would like to convert this to an array. I'd like to know if there is an easy way to convert that is effectively an array in String format into an actual array.

I'd prefer to avoid making a big loop that inserts the values from the string into a new array with find and substr but if that's required then that can be done.

๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ convert-a-string-to-character-array-in-java
Convert a String to Character Array in Java - GeeksforGeeks
The toCharArray() method is the simplest and most efficient way to convert a string to a character array.
Published: July 12, 2025