def addHtmlBreaks(inStr, nChars):
    """Adds an html line-break every nth character, and returns the resulting
    string."""
    strWithBreaks = ""
    strIdx = 0
    while (strIdx < len(inStr)):
        if (((strIdx + 1) % nChars) == 0):
            strWithBreaks = strWithBreaks + "</br>"
        strWithBreaks = strWithBreaks + inStr[strIdx]
        strIdx = strIdx + 1
    return strWithBreaks