You could achieve this with a function similar to this (this is off the cuff so if might do with a bit of refactoring / optimization)
for the sake of example, lets say that you want to insert a new line character after every fifteen characters, you would do something like this:
Private Function ParseJavaScriptString(value as String) As String
Dim charArray() as Char = value.ToCharArray()
For i as Integer = 0 to charArray.Length Step 1
'You need to add 1 to your current value since we are working off of a Zero Based index
If (i + 1) Mod = 15 then value.Insert(i, "\n")
Loop
End Function
This of course does not take phonetics into account so, for example, take the string: The sky is extremly blue today.
Your alert would display that as:
The sky is extr
mly blue today.
You could modify the above function to workin something like:
Private Function ParseJavaScriptString(value as String) As String
Dim charArray() as Char = value.ToCharArray()
Dim blnIsSpace as Boolean = True
For i as Integer = 0 to charArray.Length Step 1
If blnIsSpace
If (i + 1) Mod = 15 AND charArray(i).Equals(" ") then value.Insert(i, "\n")
else blnIsSpace = False
Else
If charArray(i).Equals(" ") Then
value.Insert(i, "\n")
blnIsSpace = True
End If
End If
Loop
End Function
Obviously you are not going to get perfectly even lines since line 1 might contain 15 characters will line 2 contains 17 and so on. It all depends on where a space falls at within the string.
hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library:
Wrox Books 24 x 7
Did someone here help you? Click

on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================