def count(self, sub, start=0, end = sys.maxint):
        '''S.count(sub[, start[, end]]) -> int
        
        Return the number of non-overlapping occurrences of substring sub in
        Unicode string S[start:end].  Optional arguments start and end are
        interpreted as in slice notation.
        '''
        string=self[start:end]
        c = 0
        # corner cases
        if string == '':
            return 1 if sub == '' else 0
        if sub == '':
            return len(string)+1

        it = StringSearch(sub,string,self._factory.collator)
        it.setAttribute(USearchAttribute.OVERLAP,False)
        try:
            while True:
                it.next()
                match = it.getMatchedText()
                if self.__class__(match) == self.__class__(sub):
                    c+=1
        except StopIteration:
            pass

        return c
    def find(self,sub, start = 0, end = sys.maxint):
        '''S.find(sub [,start [,end]]) -> int
        
        Return the lowest index in S where substring sub is found,
        such that sub is contained within S[start:end].  Optional
        arguments start and end are interpreted as in slice notation.
        
        Return -1 on failure.
        '''
        string = self[start:end]
        c = 0
        # corner cases
        if string == '':
            return 0 if sub == '' else -1
        if sub == '':
            return 0

        it = StringSearch(sub,string,self._factory.collator)
        it.setAttribute(USearchAttribute.OVERLAP,False)
        while True:
            try:
                r = it.next()
                match = it.getMatchedText()
                if self.__class__(match) == self.__class__(sub):
                    return start+r
            except StopIteration:
                return -1
    def __contains__(self,other):
        '''x.__contains__(y) <==> y in x
        '''
        if self == '':
            return other == ''

        if other == '':
            return True

        it = StringSearch(other,self,self._factory.collator)
        while True:
            try:
                it.next()
                match = it.getMatchedText()
                if self.__class__(match) == self.__class__(other):
                    return True
            except StopIteration:
                return False