What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-17 12:16:13
Delete spaces in text in javascript
str.replace(/\s+/g, '') Add solution -
Javascript 2021-11-17 00:49:18
count word and space in text javascript
<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 -
Rust 2021-11-13 02:56:14
regex to find and replace values
str = str.replace(/[^a-z0-9-]/g, ''); /* Everything between the indicates what your are looking for / is here to delimit your pattern so you have one to start and one to end [] indicates the pattern your are looking for on one specific character... Add solution -
Javascript 2021-11-12 02:17:12
escape in javascript
function escapeHtml(str) { return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;"); } Add solution
Best helpers
Ranking is empty