Here's a vb SCRIPT way.
<%
TheString = "I need to parse a long string into no more than 30 character
chunks, but I also need to leave the words intact. Right now, I am using
and it's fine, but splits up some of the words. If I could figure out how
to find the preceding space of the 30 limit, I'd be in good shape. Any
thoughts would be appreciated. Many thanks in advance."
'''clear out any double+ spaces
Do While Instr(TheString, " ") > 0
TheString = Replace(TheString, " ", " ")
Loop
aParts = Split(TheString, " ")
Redim Preserve aParts(29)
For q = 0 To 29
Response.Write aParts(q) & "<br>"
Next
%>
Ray at home
"meldrape" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hello,
I need to parse a long string into no more than 30
character chunks, but I also need to leave the words
intact. Right now, I am using:
For intStart = 1 to Len(strOriginal) by 30
strPrint = Mid$(strOriginal, intStart, 30)
Print #detailFile, Tab(1), intStart, Tab(4), strPrint
Next intStart
and it's fine, but splits up some of the words. If I
could figure out how to find the preceding space of the
30 limit, I'd be in good shape. Any thoughts would be
appreciated. Many thanks in advance.