Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
92
rated 0 times [  94] [ 2]  / answers: 1 / hits: 29544  / 7 Years ago, thu, september 7, 2017, 12:00:00

How to convert String into the array in React Native.
for example:-



var myString = 'this, is my, string';


separate string with ,
and output must be



  myArray = [this, is my, string];
on myArray[0] value is this,
on myArray[1] value is is my,
on myArray[2] value is string

More From » android

 Answers
91

Simply use string.split() to split the string into an array using commas as delimiters.



var myArray = myString.split(',');

[#56547] Tuesday, September 5, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
clarkulisesa

Total Points: 422
Total Questions: 93
Total Answers: 112

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
clarkulisesa questions
Mon, Feb 24, 20, 00:00, 4 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;