Project

General

Profile

« Previous | Next » 

Revision 3172

strings.py: Added first_word()

View differences:

lib/strings.py
111 111
    '''Strips (non-printable) control characters'''
112 112
    return ''.join(filter(lambda c: not is_ctrl(c), str_))
113 113

  
114
##### Text
115

  
116
def first_word(str_): return str_.partition(' ')[0]
117

  
114 118
##### Formatting
115 119

  
116 120
def as_tt(str_): return '@'+str_+'@'

Also available in: Unified diff