How to capture last 4 characters from NSString
You can check this function in Swift 5:
func subString(from myString: NSString, length: Int) { let myNSRange = NSRange(location: myString.length - length, length: length) print(myString.substring(with: myNSRange))}subString(from: "Menaim solved the issue", length: 4) // Output: ssue