Message 1 of 5
string manipulation

Not applicable
12-14-2004
12:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a long text string that i want to divide into 4 nearly equal
parts.
But i don't want to make the break in the middle of words. Does anyone have
a good way to do this?
i tried to use "instr" to find the nearest vbcr in the text to make the
break at a clean spot but it doesn't work.
'DEVIDE THE SEQUENCE INTO FOUR CHUNKS
Dim total As Integer
total = Len(Sequence)
Dim Y As Integer
Y = total / 4
For x = 0 To 2
While InStr(Y, Sequence, vbCrLf, vbTextCompare) = False
Y = Y + 1
Wend
mT(x) = Left(Sequence, Y)
Sequence = Right(Sequence, Len(Sequence) - Y)
Y = total / 4
Next x
mT(3) = Sequence
Any ideas?
thanks
jm