Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- int camelize(char text[]);
- int main(){
- char text[] = "Welcome to my world.";
- printf("%s\n", text);
- camelize(text);
- printf("%s\n", text);
- return 0;
- }
- int camelize(char text[]){
- if(text == NULL){
- return -1;
- }
- for(int i = 0; i < strlen(text); i++){
- if(text[i] == ' '){
- i++;
- text[i] = toupper(text[i]);
- }
- }
- int i = 0;
- while(i < strlen(text)){
- if(isspace(text[i])){
- for(int j = i; j < strlen(text); j++){
- text[j] = text[j+1];
- }
- }
- i++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement