We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d0fcb3 commit c1d4505Copy full SHA for c1d4505
1 file changed
Easy-Programming-Challenges/SwapCase.js
@@ -0,0 +1,8 @@
1
+function SwapCase(str) {
2
+ return str.replace(/[a-zA-Z]/g, function (c){
3
+ if(c.match(/[a-z]/)){
4
+ return c.toUpperCase();
5
+ }
6
+ return c.toLowerCase();
7
+ });
8
+}
0 commit comments