How to convert english numbers inside a string to Persian/Arabic numbers in Objective-C?

前端 未结 10 1982
轮回少年
轮回少年 2021-01-18 10:53

I have an english string that may or may not have numbers. But i want those numbers to be printed on screen as Persian numbers.

For example if NSString *foo =

10条回答
  •  借酒劲吻你
    2021-01-18 11:42

    I'm afraid there is no other way than replacing them.

    e.g.:

    str =[str stringByReplacingOccurrencesOfString:@"0" withString:@"۰"];
    .
    .
    .
    

提交回复
热议问题