Splitting string over word boundry

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need to split a string in chunks of max 160 characters but ensuring that
no word is broken. How can I do this?

Thanks

Regards
 
John said:
I need to split a string in chunks of max 160 characters but
ensuring that no word is broken. How can I do this?

Have a look at the String's members like IndexOf, SubString, Chars etc.


Armin
 
Hi

I need to split a string in chunks of max 160 characters but ensuring that
no word is broken. How can I do this?

Thanks

Regards

As long as there is a space between each word, you can split the words
out to a string array with the Split function.
 
but how to ensure each split is upto 160 characters?

Hi

I need to split a string in chunks of max 160 characters but ensuring that
no word is broken. How can I do this?

Thanks

Regards

As long as there is a space between each word, you can split the words
out to a string array with the Split function.
 
but how to ensure each split is upto 160 characters?

Like Armin implies with his response, you will need to manually parse
it yourself using the string class methods provided like IndexOf,
SubString, etc.
 
Back
Top