ios - Replace character in NSMutableAttributedString -
this works regular nsstring
:
nsstring *newstring = [mystring stringbyreplacingoccurrencesofstring:@"," withstring:@""];
but there no such method nsmutableattributedstring
. how remove instances of comma in nsmutableattributedstring
?
do before create attributed string, if can or depending on how source it. if can't can use replacecharactersinrange:withstring:
(or replacecharactersinrange:withattributedstring:
), need know range need search , iterate yourself.
Comments
Post a Comment