Created
April 4, 2014 00:49
-
-
Save loufranco/9965893 to your computer and use it in GitHub Desktop.
Capitalize the first uncapped word
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
char* capper(char* s, char* outs) { | |
strcpy(outs, s); | |
for (char* s2=outs; *s2; ++s2) { | |
if (islower(*s2) && (s2==outs || isspace(*(s2-1)))) { | |
*s2=toupper(*s2); | |
break; | |
} | |
} | |
return outs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For this: https://twitter.com/jessitron/status/451849259936014336