What do you want to save?
Add Code snippet
New code examples
-
Java 2022-03-19 17:25:23
replace character in string java
public static void main(String args[]){ String s1="my name is khan my name is java"; String replaceString=s1.replace("is","was");//replaces all occurrences of "is" to "was" System.out.println(replace... Add solution -
Javascript 2022-03-19 10:15:11
string methods javascript count number of words inside a string
<html> <body> <script> function countWords(str) { str = str.replace(/(^\s*)|(\s*$)/gi,""); str = str.replace(/[ ]{2,}/gi," "); str = str.replace(/\n /,"\n"); return str.split(' ').length; }... Add solution -
PHP 2022-03-18 02:10:01
add slashes to string
str = str.replace(/'/g, "\\'"); Add solution -
Javascript 2022-03-17 18:45:24
format number thousands k javascript
function nFormatter(num, digits) { var si = [ { value: 1, symbol: "" }, { value: 1E3, symbol: "k" }, { value: 1E6, symbol: "M" }, { value: 1E9, symbol: "G" }, { value: 1E12, symbol: "T&quo... Add solution
Best helpers
Ranking is empty