Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

split first character of string in javascript

const str = 'Hello';

const chars = str.split('');
console.log(chars[0]);
// expected output: "H"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #character #string #javascript
ADD COMMENT
Topic
Name
1+5 =