Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var str = "the-first-name";
- console.log(str.replace(/-(\w)/g, function ($, $1) {
- return $1.toUpperCase();
- })); // theFirstName
- str = "100000000000";
- console.log(str.replace(/(?=(000)+$)/g, ".")) // 100.000.000.000
Add Comment
Please, Sign In to add comment