Replacing one character in a string in Objective-C

前端 未结 4 845
故里飘歌
故里飘歌 2020-11-30 07:22

Hoping somebody can help me out - I would like to replace a certain character in a string and am wondering what is the best way to do this?

I know the location of th

4条回答
  •  感动是毒
    2020-11-30 07:58

    Here is the code:

    [aString stringByReplacingCharactersInRange:NSMakeRange(3,1) withString:@"B"];
    

提交回复
热议问题