 extension String {
     
     var uppercasedFirstCharacter: String {
-        let index = startIndex.advancedBy(1)
-        return substringToIndex(index).uppercaseString + substringFromIndex(index)
+        let index = characters.index(startIndex, offsetBy: 1)
+        return substring(to: index).uppercased() + substring(from: index)
     }
 
     var lowercasedFirstCharacter: String {
-        let index = startIndex.advancedBy(1)
-        return substringToIndex(index).lowercaseString + substringFromIndex(index)
+        let index = characters.index(startIndex, offsetBy: 1)
+        return substring(to: index).lowercased() + substring(from: index)
     }
 
     var words: [String] {
-        return componentsSeparatedByCharactersInSet(NSCharacterSet.whitespaceCharacterSet()).filter { !$0.isEmpty }
+        return components(separatedBy: CharacterSet.whitespaces).filter { !$0.isEmpty }
     }
     
     var paintcodeCaseFromWords: String {

        }
    }

    func wordsMatchingWordsArray(wordsArray: [String]) -> String? {
        let lowercasedWords = self.lowercasedWords
        return wordsArray.filter { words in
            return lowercasedWords == words.lowercasedWords

    }
    
    var lowercasedWords: String {
        return wordsFromCamelCase.lowercased()
    }
    
    func longestWordsMatch(inPrefixes prefixes: [String]) -> String {
        return prefixes.reduce("") { (longest, prefix) in
            return prefix.characters.count > longest.characters.count
                && self.lowercasedWords.hasPrefix(prefix.lowercasedWords)
