By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

Splitting string over word boundry

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On May 7, 8:52*am, "John" <i...@nospam.infovis.co.ukwrote:
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.
Jun 27 '08 #2

P: n/a
but how to ensure each split is upto 160 characters?

<za***@construction-imaging.comwrote in message
news:93**********************************@i76g2000 hsf.googlegroups.com...
On May 7, 8:52 am, "John" <i...@nospam.infovis.co.ukwrote:
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.
Jun 27 '08 #3

P: n/a
"John" <in**@nospam.infovis.co.ukschrieb
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

Jun 27 '08 #4

P: n/a
On May 7, 9:26*am, "John" <i...@nospam.infovis.co.ukwrote:
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.
>
<za...@construction-imaging.comwrote in message

news:93**********************************@i76g2000 hsf.googlegroups.com...
On May 7, 8:52 am, "John" <i...@nospam.infovis.co.ukwrote:
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.
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.