Answers for "javascript get character from string"

12

javascript get first character of string

var str="Hello Folks!"
var firstStringChar = str.charAt(0); //H
Posted by: Guest on August-01-2019
2

javascript get character from string

// (ES6 / ES2015)+ way of doing it
const str = "Hello World!";
const chars = [...str];

// Pre-ES2015 way of doing it
var chars2 = str.split("");
Posted by: Guest on February-27-2021
0

javascript get character from string

const str = "Hello World";
const firstCharacter = str.charAt(0);
Posted by: Guest on March-02-2021

Code answers related to "javascript get character from string"

Code answers related to "Javascript"

Browse Popular Code Answers by Language