It depends how easy you find the following, which uses simple String methods (in this case slice()
).
var str = "Hello World";
str = str.slice(0, 3) + str.slice(4);
console.log(str)
More Related Contents:
- Count the recurrence of a word
- Repeat a string in JavaScript a number of times
- Check if a JavaScript string is a URL
- How to check if a string contains text from an array of substrings in JavaScript?
- How to remove text from a string?
- How to replace all dots in a string using JavaScript
- How can I convert a comma-separated string to an array?
- How to set object property (of object property of..) given its string name in JavaScript?
- Shorten string without cutting words in JavaScript
- How to find indices of all occurrences of one string in another in JavaScript?
- How can I insert a character after every n characters in javascript?
- How can I remove a character from a string using JavaScript?
- Javascript – return string between square brackets
- Case insensitive string replacement in JavaScript?
- JavaScript string with new line – but not using \n
- Remove characters from a string [duplicate]
- is the + operator less performant than StringBuffer.append()
- How to extract base URL from a string in JavaScript?
- Get the string representation of a DOM node
- How to convert text to binary code in JavaScript?
- How do I escape a string inside JavaScript code inside an onClick handler?
- Commas messing with number input in Javascript
- Are double and single quotes interchangeable in JavaScript?
- Use RegExp to match a parenthetical number then increment it
- compare strings and get end difference
- Javascript – Template Strings Don’t Pretty Print Objects
- Removing backslashes from strings in javascript
- javascript and string manipulation w/ utf-16 surrogate pairs
- JavaScript: replace last occurrence of text in a string
- Find and replace nth occurrence of [bracketed] expression in string