Answers for "Get the first letter of each word in a string js"

2

get first word of string js

let myStr = "Hello World"
let firstWord = myStr.split(" ")[0]
Posted by: Guest on March-14-2021
1

js get words first letter

var str = "Java Script Object Notation";
var matches = str.match(/\b(\w)/g); // ['J','S','O','N']
var acronym = matches.join(''); // JSON

console.log(acronym)
Posted by: Guest on April-12-2020

Code answers related to "Get the first letter of each word in a string js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language