Search code examples
iosuilabelline-breaks

UILabel lineBreakMode, break at specific character


Is there a way to break the text in a UILabel at a specific character say ";" ??

I don't want it to be broken with Word Wrap or character Wrap.


Solution

  • Sure, just replace all the occurrences of ";" with ";\n" before you show the string.