     }
     
     public var emojiRanges: [NSRange] {
-        var emojiRangesArray = [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 {
-                                    let sub = NSString(string:substring)
-                                    if sub._containsAnEmoji() {
-                                        emojiRangesArray.append(substringRange)
-                                    }
-                                }
+            if let substring = substring {
+                if NSString(string: substring)._containsAnEmoji() {
+                    ranges.append(substringRange)
+                }
+            }
         }
-        return emojiRangesArray
+        return ranges
     }
     
     public var containsEmoji: Bool {

            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
                                    }
                                }
        }
        return isEmoji
    }

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