Answers for "slice string javascript from index to space"

0

slice string javascript from index to space

const data ="Hello my name is Hastings"
data = data.slice(0, data.indexOf(" ")); 
console.log(data)
//Output = "Hello"
Posted by: Guest on August-09-2021

Code answers related to "slice string javascript from index to space"

Code answers related to "Javascript"

Browse Popular Code Answers by Language