Javascript examples for String Operation:String Character
Find Characters and wrap with HTML
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {// w w w .j a v a 2 s . c om var mystring = "abc//def////ghi///jkl/mno"; mystring = mystring.replace(/((?:\/{2})+)/g, "<span class=\"slashes\">$1</span>"); console.log(mystring); }); </script> </head> <body> </body> </html>