@ Caveatrob: Также предполагается, что вы разбиваете на пробелы:
<%
Option Explicit
Function TrimIt(sInput, iLength)
Dim aWords, iCounter, sOutput, sTmp
sOutput = sInput
If InStr(sInput, " ") > 0 Then
aWords = Split(sInput, " ")
For iCounter = 0 To UBound(aWords)
If Len(aWords(iCounter) & " ") + Len(sTmp) <= iLength Then
sTmp = sTmp & " " & aWords(iCounter)
Else
Exit For
End If
Next
sOutput = sTmp
End If
TrimIt = sOutput
End Function
Response.Write TrimIt("This works slightly better", 11)
%>