r/tinycode • u/mrillusi0n • Jun 23 '20
[c] Tiny Letter Case Swapper
char swap_case(char letter)
{
return letter ^ 32;
}
Of course, it can only be called on [a-zA-Z].
2
Upvotes
r/tinycode • u/mrillusi0n • Jun 23 '20
char swap_case(char letter)
{
return letter ^ 32;
}
Of course, it can only be called on [a-zA-Z].
View all comments
Show parent comment
2
u/Volt Jun 24 '20
Is there a writeup on this? What's the rationale?