maej90
maej90

Reputation: 51

Replace characters with accents - ios

I've been searching for a solution to my issue and cant find anything at all.

I want to replace the content of a NSString like this "Depósitos y Préstamos" into this "Depósitos y Préstamos".

Any Idea how to solve it?

Thanks in advance.

Upvotes: 0

Views: 404

Answers (1)

lucaslt89
lucaslt89

Reputation: 2451

you could use the NSString method

-(NSString*)stringByReplacingOccurrencesOfString:withString:

for each accentuated symbol. For example, for the ó in Depósitos, you could use this:

NSString *depositosCorrecto = [depositosIncorrecto stringByReplacingOccurrencesOfString:@"ó" withString:@"ó"];

So, how can you get those extrange symbols in xCode? Just do as i did, copy an paste them from where you're getting it written.
Hope it helps!
Lucas

EDIT

I found this table that may be helpful.

Upvotes: 1

Related Questions