def SplitInLines(text, lw=80):
    """
    Split a string into words and combine the words into new lines that
    are shorter than the line width 'lw'.

    Returns an array of strings (which do not contain the '
' character)
    and can be interpreted as the lines of the string.
    """
    if lw < 30:
        print('Warning: In sdf_utils.SplitInLines():')
        print('         Linewidth is getting too narrow ( < 30 chars).')
        print('         Start to ignore the linewidth parameter.')
        lw = 1000000
    res = []
    words = str(text).split()
    line = ''
    for word in words:
        if len(line) + len(word) + 1 <= lw:
            line = line + ' ' + word
        else:
            res.append(line.strip())
            line = ''
    if res == []:
        res.append(line.strip())
    return res
