← Back to challenges

Reverse String Without Affecting Special Characters

JavaScriptHardlogicstringsregex

Instructions

Reverse the string without affecting special characters and numbers.

Examples

revSpecstring("AFC#47GH$Ieu") ➞ "ueI#47HG$CFA"

revSpecstring("guyhiuj1234!@#$%rtyhghu") ➞ "uhghytr1234!@#$%juihyug"

revSpecstring("12!@" ) ➞ "12!@"

Notes

Try with for loops.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.