             NSRange(location: 0, length: s.length),
                               options: .byComposedCharacterSequences) {
                                 (substring, substringRange, _, stop) in
-                                if let substring = substring {
-                                    let sub = NSString(string:substring)
-                                    if sub._containsAnEmoji() {
-                                        isEmoji = true
-                                        // Stops the enumeration by setting the unsafe pointer to ObjcBool memory value, false by default in the closure parameters, to true.
-                                        stop[0] = true
-                                    }
-                                }
+            if let substring = substring {
+                if NSString(string:substring)._containsAnEmoji() {
+                    isEmoji = true
+                    // Stops the enumeration by setting the unsafe pointer to ObjcBool memory value, false by default in the closure parameters, to true.
+                    stop[0] = true
+                }
+            }
         }
         return isEmoji
     }

    
    public var condensedWhitespace: String {
        #if os(OSX)
            let components = self.components(separatedBy: CharacterSet.whitespacesAndNewlines)
        #else
            let components = self.components(separatedBy: NSCharacterSet.whitespacesAndNewlines())
        #endif

    }
    
    public var emojiRanges: [NSRange] {
        var ranges = [NSRange]()
        let s = NSString(string:self)
        s.enumerateSubstrings(in: NSRange(location: 0, length: s.length),
                              options: .byComposedCharacterSequences) {
                                (substring, substringRange, _, _) in
            if let substring = substring {
                if NSString(string: substring)._containsAnEmoji() {
                    ranges.append(substringRange)
                }
            }
        }
        return ranges
    }
    
    public var containsEmoji: Bool {
