Revision 3172
Added by Aaron Marcuse-Kubitza over 12 years ago
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
strings.py: Added first_word()