-1

I would like to convert a String into an Array. My string looks like this:

First-Second-Third-Fourth-Fifth-Sixth

and my Array should look like this:

["First", "Second", "Third", "Fourth", "Fifth", "Sixth"]

Is there any way to do that?

profidash_98
  • 321
  • 2
  • 4
  • 19
  • *Is there any way to do that?* No, unless you have a computing device which is [Turing complete](https://en.wikipedia.org/wiki/Turing_completeness). –  Aug 20 '17 at 06:50

1 Answers1

1

Sure, you can split the string:

var myArray = myString.split('-');
Agu Dondo
  • 12,638
  • 7
  • 57
  • 68