Cheddar, 118 104 bytes
(s)->s.chars.map((i)->{if String.letters has i.lower{if i<"a"{i+i.lower}else{i+i.upper}}else{i}}).join()
First real Cheddar answer!!! This is a lot less climactic than I thought it would be... ;_;
Works with release 1.0.0-beta.9, non-competing.
As you can tell I didn't design cheddar to be golfy :/
Ungolfed:
(str) -> str.chars.map(
(i) -> {
if String.letters has i {
if i < "a" { // Check char code, meaning it's upper case if true
i+i.lower
}
else {
i+i.upper
}
} else {
i
}
}
).join()
Usage:
var doThing = <code here>;
doThing("input...");
Update: 7/14/16 I've finished ternaries making this come down to 84 bytes
Cheddar, 84 bytes
(s)->s.chars.map((i)->String.letters has i.lower?i<"a"?i+i.lower:i+i.upper:i).join()
works as of version v1.0.0-beta.14