Change the first character in each word of a string to uppercase

前端 未结 2 926
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 18:25

I found the function below :

CFStringCapitalize

\"Changes the first character in each word of a string to uppercase (if it is a low

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 19:04

    (NSString *)capitalizedString
    

    So:

    NSString *myString,*myCapitalizedString;
    
    myString = @"capitalize";
    myCapitalizedString = [myString capitalizedString]; //produces a capitalized copy of 'myString'
    

提交回复
热议问题