( loc, strg )
Returns the line of text containing loc within a string, counting newlines as line separators.
Returns the line of text containing loc within a string, counting newlines as line separators.
Returns the line of text containing loc within a string counting newlines as line separators .
def line( loc, strg ):
    """Returns the line of text containing loc within a string, counting newlines as line separators.
       """
    lastCR = strg.rfind("\n", 0, loc)
    nextCR = strg.find("\n", loc)
    if nextCR >= 0:
        return strg[lastCR+1:nextCR]
    else:
        return strg[lastCR+1:]
def line ( loc , strg ) : lastCR = strg . rfind ( "\n" , 0 , loc ) nextCR = strg . find ( "\n" , loc ) if nextCR >= 0 : return strg [ lastCR + 1 : nextCR ] else : return strg [ lastCR + 1 : ]