         let data: NSData = NSData(base64EncodedString: string as String, options: NSDataBase64DecodingOptions(rawValue: 0))!
         return NSString(data: data, encoding: NSUTF8StringEncoding)! as String
     }
-    
-    // MARK: - Instance functions -
-    
-    func length() -> Int
-    {
-        return count(self)
-    }
-    
-    func characterAtIndex(index: Int) -> Character
-    {
-        return self[advance(self.startIndex, index)]
-    }
-    
-    func substringFromIndex(index: Int) -> String
-    {
-        return self[advance(self.startIndex, index)...advance(self.startIndex, self.length())]
-    }
-    
-    func substringToIndex(index: Int) -> String
-    {
-        return self[advance(self.startIndex, 0)...advance(self.startIndex, index)]
-    }
-    
-    func searchCharStart(charStart: Character, charEnd: Character) -> String
-    {
-        return String.searchInString(self, charStart: charStart, charEnd: charEnd)
-    }
-    
-    func hasString(string: String, caseSensitive: Bool = true) -> Bool
-    {
-        if caseSensitive
-        {
-            return self.rangeOfString(string) != nil
-        }
-        else
-        {
-            return self.lowercaseString.rangeOfString(string.lowercaseString) != nil
-        }
-    }
-    
-    func isEmail() -> Bool
-    {
-        return String.isEmail(self)
-    }
-    
-    func encodeToBase64() -> String
-    {
-        return String.encodeToBase64(self)
-    }
-    
-    func decodeBase64() -> String
-    {
-        return String.decodeBase64(self)
-    }
-    
-    func sentenceCapitalizedString() -> String
-    {
-        if self.length() == 0
-        {
-            return ""
-        }
-        let uppercase: String = self.substringToIndex(1).uppercaseString
-        let lowercase: String = self.substringFromIndex(1).lowercaseString
-        
-        return uppercase.stringByAppendingString(lowercaseString)
-    }
-    
-    func dateFromTimestamp() -> String
-    {
-        let year: String = self.substringToIndex(4)
-        var month: String = self.substringFromIndex(5)
-        month = month.substringToIndex(4)
-        var day: String = self.substringFromIndex(8)
-        day = day.substringToIndex(2)
-        var hours: String = self.substringFromIndex(11)
-        hours = hours.substringToIndex(2)
-        var minutes: String = self.substringFromIndex(14)
-        minutes = minutes.substringToIndex(2)
-        
-        return "\(day)/\(month)/\(year) \(hours):\(minutes)"
-    }
-    
-    func URLEncode() -> String
-    {
-        return self.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLHostAllowedCharacterSet())!
-    }
-    
-    // TODO: Missing hash functions
-    
-    func MD5() -> String
-    {
-        return ""
-    }
-    
-    func SHA1() -> String
-    {
-        return ""
-    }
-    
-    func SHA256() -> String
-    {
-        return ""
-    }
-    
-    func SHA512() -> String
-    {
-        return ""
-    }
 }


extension String
{
    // MARK: - Class functions -
    
    static func searchInString(string: String, charStart: Character, charEnd: Character) -> String
    {
        var inizio = 0, stop = 0
        
        for var i = 0; i < string.length(); i++
        {
            if string.characterAtIndex(i) == charStart
            {
                inizio = i+1
                i += 1
            }
            if string.characterAtIndex(i) == charEnd

            }
        }
        
        stop -= start
        
        var string: String = string.substringFromIndex(start-1)
        string = string.substringFromIndex(0)
        
        return string
