What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-21 20:20:02
how to replace the last character of a string in python
sample_string = "712345677890 173445667" # if i wanted to do: new_string=sample_string.replace("7", r) print new_string #you won't get your results #Output: r123456rr890 1r344566r #but i wanted it to be 712345677890 17344566r #there ar... Add solution -
Javascript 2022-02-10 22:30:16
js strip multiple spaces
string = string.replace(/\s\s+/g, ' '); Add solution -
Javascript 2022-01-28 21:06:02
how to strip html tags in javascript
var htmlString= "<div>\n <h1>Hello World</h1>\n <p>This is the text that we should get.</p>\n <p>Our Code World &#169; 2017</p>\n </div>"; var stripedHtml = htmlString.replace(/<[^>]+>... Add solution -
Javascript 2022-01-26 05:02:14
find capital word in string javascript
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2022-01-23 00:20:50
return first letter of string javascript in uppercase
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2021-11-20 09:23:37
regular expression replace a dot
mystring = mystring.replace(/\./g,' ') Add solution
Best helpers
Ranking is empty