I have a scenario to change the color of single repeat characters '#' in a string just like as image shown below. I m using this code.
let textTag = lblNewsTag.text
let range = (textTag! as NSString).rangeOfString("#")
let attributedString = NSMutableAttributedString(string:textTag!)
attributedString.addAttribute(NSForegroundColorAttributeName, value: UIColor.redColor() , range: range)
lblTag.attributedText = attributedString