Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Returns a string that has at most one whitespace
character between non-whitespace characters.

>>> trim_whitespace(' hi   there')
'hi there'

        def trim_whitespace(s):
    """ 
    Returns a string that has at most one whitespace
    character between non-whitespace characters.

    >>> trim_whitespace(' hi   there')
    'hi there'
    """
    buffer  = ''
    for i, letter in enumerate(s):
         if letter.isspace():
             try:
                 if s[i+1].isspace(): continue
             except IndexError: 
                 pass
         buffer = buffer + letter
    
    return buffer.strip()
        


src/s/l/slate-0.3/src/slate/slate.py   slate(Download)
        """
        if clean:
            return ''.join(utils.trim_whitespace(page) for page in self)
        else:
            return ''.join(self)