Project

General

Profile

« Previous | Next » 

Revision 2585

strings.py: Added add_suffix()

View differences:

lib/strings.py
32 32
    if removed_ref[0]: return str_[:-len(suffix)]
33 33
    else: return str_
34 34

  
35
def add_suffix(str_, suffix, max_len): return str_[:max_len-len(suffix)]+suffix
36

  
35 37
def contains_any(haystack, needles):
36 38
    for needle in needles:
37 39
        if haystack.find(needle) >= 0: return True

Also available in: Unified diff