I am gating text This "www%2Egoogle%2Ecom%20%0Await"
Then i am using This code for Decrypted let DecodeMSG = msg.stringByReplacingPercentEscapesUsingEncoding(NSUTF8StringEncoding)!
Then %20%0A is New line show automaticlly
www.google.com
wait
how split word from there
i am using this Code
for var i = 0; i < splitStringArray.count ; i++
{
let word:String = splitStringArray[i];
if word.hasPrefix("www") || word.hasPrefix("http")
{
print(word)
let trimmed = word.stringByReplacingOccurrencesOfString("^\\n",
withString: "", options: .RegularExpressionSearch)
print("trimmed == \(trimmed)")
let range: Range<String.Index> = (str.rangeOfString(word)!)
let start:Int = Int("\(range.startIndex)")!
let end:Int = word.characters.count
// print(start)
text.addAttribute(TapLabel.LinkContentName, value: word, range: NSMakeRange(start, end))
text.addAttribute(NSForegroundColorAttributeName, value: UIColor.blueColor(), range: NSMakeRange(start, end))
text.addAttribute(TapLabel.SelectedForegroudColorName, value: UIColor.redColor(), range: NSMakeRange(start, end))
}
}
messageLabel.attributedText = text
My link create whole word but i want to split word if using new new line
Please help me .