An example using NSMutableAttributedString.  This example adds attributes to substrings at particular ranges in the string.