To parse it you need to use double quotes instead of single.

This should work:

services = '["service1", "service2", "service3"]'
JSON.parse(services)
Answer from Erick R Soto 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.
Discussions

javascript - Convert string with commas to array - Stack Overflow
In this case alert shows 0,1. If it where an array, it would show 0. And if alert(array[1]) is called, it should pop-up 1 ยท Is there any chance to convert such string into a JavaScript array? More on stackoverflow.com
๐ŸŒ stackoverflow.com
help convert nested string array objects to array
JSON.parse is clever - I like that. You can shorten it a bit though with map: str = [ "[1, 2]", "[2, 3]", "[4, 6]" ] let strArrays = str.map(JSON.parse) More on reddit.com
๐ŸŒ r/learnjavascript
3
4
March 19, 2022
How to convert Array formatted as String to Array?
JSON convert. var result = System.Text.Json.JsonSerializer.Deserialize(jsonString); More on reddit.com
๐ŸŒ r/learncsharp
6
5
March 22, 2023
Converting a String to an Array
๐ŸŒ r/godot
4
6
October 24, 2023
People also ask

Can we convert a string into a list instead of an array?
Yes, a string can be converted into a list by iterating over its characters or using built-in methods that transform it into a list of substrings or characters.
๐ŸŒ
upgrad.com
upgrad.com โ€บ home โ€บ tutorials โ€บ software & tech โ€บ string to array in java
Converting String to Array in Java: A Comprehensive Guide
How to handle empty strings when converting to an array?
You can handle empty strings by checking if the string is empty before conversion, setting a default value, or filtering out empty elements after conversion.
๐ŸŒ
upgrad.com
upgrad.com โ€บ home โ€บ tutorials โ€บ software & tech โ€บ string to array in java
Converting String to Array in Java: A Comprehensive Guide
What is a string in Java?
A string in Java is a sequence of characters enclosed within double quotes. String in Java are immutable that means once they are created their value canโ€™t change. Any modifications to a string results in a new string object being created. A string in Java is a sequence of characters enclosed within double quotes. String in Java are immutable that means once they are created their value canโ€™t change. Any modifications to a string results in a new string object being created. In Java, strings are fundamental data types used extensively in software development. However, there are scenarios where
๐ŸŒ
upgrad.com
upgrad.com โ€บ home โ€บ tutorials โ€บ software & tech โ€บ string to array in java
Converting String to Array in Java: A Comprehensive Guide
๐ŸŒ
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.
๐ŸŒ
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, ...
๐ŸŒ
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.
๐ŸŒ
Upgrad
upgrad.com โ€บ home โ€บ tutorials โ€บ software & tech โ€บ string to array in java
Converting String to Array in Java: A Comprehensive Guide
August 27, 2025 - An array in Java is a data structure that stores multiple values of the same type in a contiguous memory location. Converting a string to array in java allows for easier processing, which includes extracting individual characters, splitting words, or performing operations like searching and sorting.
Find elsewhere
๐ŸŒ
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 - This method splits the string into individual characters and returns an array containing those characters. Store the resulting character array in the variable charArray. Iterate over the charArray using a for-each loop to print each character ...
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ convert string to array in java
String to Array in Java - Scaler Topics
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.
๐ŸŒ
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.
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_tostring_array.asp
JavaScript Array toString() Method
The toString() method returns a string with array values separated by commas.
๐ŸŒ
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
๐ŸŒ
CodingNomads
codingnomads.com โ€บ javascript-array-to-string-conversion
JavaScript Array-String Conversion
The output will be: Our team members are Alice, Bob, Charlie, and Dana. Next up, you'll be checking out the .split() method, which is like the inverse of .join(). It's used to convert a string to an array.
๐ŸŒ
WsCube Tech
wscubetech.com โ€บ resources โ€บ java โ€บ programs โ€บ string-to-array
Convert String To Array in Java (6 Programs)
September 16, 2026 - Learn how to convert a String to an Array in Java with examples. Explore methods like for loop, split(), toCharArray(), split(" "), and more. Read now!
๐ŸŒ
Reddit
reddit.com โ€บ r/learncsharp โ€บ how to convert array formatted as string to array?
r/learncsharp on Reddit: How to convert Array formatted as String to Array?
March 22, 2023 -

I'm given these strings of formatted arrays

"["cat","dog","horse"]"

"[1123,1234,2345]"

How do I format them into an array such that

arr[0] = "cat" arr[1] = "dog" arr[2] = "horse"

or

arr[0] = 1123 arr[1] = 1234 arr[2] = 2345

๐ŸŒ
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']
๐ŸŒ
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.

๐ŸŒ
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.
๐ŸŒ
ReqBin
reqbin.com โ€บ code โ€บ javascript โ€บ jaarxzpl โ€บ javascript-string-to-array-example
How do I convert string to array in JavaScript?
March 9, 2023 - The optional "limit" parameter specifies how many times to split the string. The array.from() method and the spread ("...") operator convert a string into an array of characters. In this JavaScript String to Array conversion ...