logo
Search
showing results for - "slice string javascript from index to space"
Alex
21 Oct 2019
1const data ="Hello my name is Hastings"
2data = data.slice(0, data.indexOf(" ")); 
3console.log(data)
4//Output = "Hello"
similar questions
slice string jshow to remove spaces from strings javascriptsplit empty string javascriptjavascript remove spaces at the beginning of the end of the stringjs find space in stringhow to erase spaces from a string javascriptjs slice string at wordjavascript slice string from characterseparate string by space javascriptjs remove spacesjavascript remove space from stringjs remove space before stringjs string slicingtrim nodejs sentence from spacesremove space from string javascriptsplit by whitespace javascriptdelete space from string javascriptremove spaces in a string jsslice javascript stringjs split string at indexjavascript get string from array with space betweenjs split text on spacesslice string javascript if has 40
queries leading to this page
javascript how to slice a string on spacestring slice when find space javascriptslice string javascript from index to space
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue