

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do you convert a string to a character array in JavaScript?
To convert a string to a character array, use the substring() JavaScript method. This displays the character of the string one at a time as a character array.
Example
You can try to run the following code to convert a string to a character array −
<html> <head> <title>JavaScript Arrays</title> </head> <body> <script> var str = "Amit"; for (var i = 0, j = str.length; i < j; i++) { alert(str.substring(i, i + 1)); } </script> </body> </html>
- Related Questions & Answers
- How do you convert a JavaScript date to UTC?
- Java program to convert a character array to string
- How do you reverse a string in place in JavaScript?
- How do you convert list to array in Java?
- Convert character array to string in Arduino
- Convert string to character array in Arduino
- How do you convert a list collection into an array in C#?
- How do I split a string, breaking at a particular character in JavaScript?
- How to convert a single character to string in C++?
- In how many ways we can convert a String to a character array using Java?
- How do you convert an ArrayList to an array in Java?
- How do I convert a string into an integer in JavaScript?
- How do you get a timestamp in JavaScript?
- How do you check if a variable is an array in JavaScript?
- How do you loop through a C# array?
Advertisements