Skip to content

Instantly share code, notes, and snippets.

@loufranco
Created April 4, 2014 00:49
Show Gist options
  • Save loufranco/9965893 to your computer and use it in GitHub Desktop.
Save loufranco/9965893 to your computer and use it in GitHub Desktop.
Capitalize the first uncapped word
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;
}
@loufranco
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment