CutLeft

Cuts the left part respecting words, without cutting words


Public

Tested

My Own Work
Function CutLeft(InText,TLen)
    CutLeft=InText
    If InText="" then Exit function
    'CutLeft=Replace(CutLeft,chr(13) & Chr(10),"
")
    if len(CutLeft)>TLen then
        NewT=left(CutLeft,TLen)
        for i=len(NewT)-1 to 1 step -1
            if mid(NewT,i,1)=" " then
                NewT=Left(CutLeft,i) & "..."
                Exit for
            end if
        next
        CutLeft=NewT
        'if Ucase(Left(CutLeft,4))="
" then CutLeft=Mid(CutLeft,5)
    end if
End Function

InText,TLen

Views 4456 Downloads 1258

Classic ASP Texts + Strings
ANmarAmdeen
813
Revisions

v2.0