      - returns: i:th character in the string
      */
     subscript (i: Int) -> Character {
-        return self[self.characters.index(self.startIndex, offsetBy: i)]
+        return self[self.index(self.startIndex, offsetBy: i)]
     }
 
     /**

    - returns: the substring
    */
    public func substring(startIndex: Int, length: Int) -> String {
        let start = self.characters.index(self.startIndex, offsetBy: startIndex)
        let end = self.characters.index(self.startIndex, offsetBy: startIndex + length)
        
        return String(self[start..<end])
    }

    - returns: String length in number of characters.
    */
    public var length: Int {
        return self.count
    }

    /** 
