' strText: den text som man skall radbryta
' iSplitAfter: antal tecken innan radskift
Function SplitText(strText, iSplitAfter)
iPos1 = 1
iPos2 = 1
iWordLength = 0
strText = Trim(strText)
Do Until iPos2 = Len(strText)
iPos2 = iPos2 + 1
iWordLength = iWordLength + 1
If Mid(strText,iPos2,1) = " " Then
iWordLength = 0
End if
If iWordLength > iSplitAfter Then
strText = Mid(strText,1,iPos1-1)_
& Mid(strText,iPos1,iPos2-iPos1)_
& " " & Mid(strText,iPos2,Len(strText)-iPos2+1)
iPos1 = iPos2
iPos2 = iPos2 + 1
iWordLength = 0
End If
Loop
strText = Replace(server.HTMLEncode(strText),vbCrlf,"
")
Response.Write strText
End Function