Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let addSpaces = (str) => {
- str = str.replace(/([A-Z])/g, ' $1');
- let removeInitBlank = () => {
- return str.replace(/^\s/, '');
- }
- return removeInitBlank();
- };
- /* for example */
- addSpaces('ILoveJavascript!'); // I Love Javascript!
Add Comment
Please, Sign In to add comment