Created
July 24, 2015 10:00
-
-
Save JavaScript-Packer/74476abb718ce47b2f1f to your computer and use it in GitHub Desktop.
Switch uppercase with lowercase and vice versa...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function swapcase(t) { | |
return t.replace(/([a-z]+)|([A-Z]+)/g, function(t, w) { | |
return w ? t.toUpperCase() : t.toLowerCase(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment