admin管理员组

文章数量:1126367

How do you convert a string to a character array in JavaScript?

I'm thinking getting a string like "Hello world!" to the array
['H','e','l','l','o',' ','w','o','r','l','d','!']

How do you convert a string to a character array in JavaScript?

I'm thinking getting a string like "Hello world!" to the array
['H','e','l','l','o',' ','w','o','r','l','d','!']

Share Improve this question edited Mar 18, 2023 at 9:26 Peter Mortensen 31.6k22 gold badges109 silver badges133 bronze badges asked Dec 28, 2010 at 16:40 DarkLightADarkLightA 15.6k18 gold badges51 silver badges57 bronze badges
Add a comment  | 

16 Answers 16

Reset to default 568

Note: This is not unicode compliant. "I

本文标签: javascriptHow can I get a character array from a stringStack Overflow