def wrap(width, text):
    """
    Split strings into width for
    wrapping
    """
    lines = []

    arr = text.split()
    lengthSum = 0

    line = []
    for var in arr:
        lengthSum += len(var) + 1
        if lengthSum <= width:
            line.append(var)
        else:
            lines.append(" ".join(line))
            line = [var]
            lengthSum = len(var)

    lines.append(" ".join(line))

    return lines