reverse a string without affecting special characters in javascript

Solutions on MaxInterview for reverse a string without affecting special characters in javascript by the best coders in the world

showing results for - "reverse a string without affecting special characters in javascript"
Ana Paula
21 Apr 2016
1var stringIn = 'name@gmail.com';
2var rev = stringIn.replace(/[a-z]+/gi, function(s){return s.split('').reverse().join('')});
3document.write(rev); // eman@liamg.moc