Jump to content




splitting a string by length and words


  • You cannot reply to this topic
2 replies to this topic

#1 ChiknNuggets

  • Members
  • 130 posts

Posted 14 July 2012 - 03:23 AM

well i got blurb{"Blurb1 blah blah blah blah blah","Blurb1 blah blah blah blah blah") and so on and each blurb cant be more then 26 characters per line(there is only 2 lines), i did manage to split it at char 26 but then the words might be cut in half, so my question is whats code would i use to make it so only 26 chars(at max) per line and if it cuts middle of a word it puts that whole word onto next line?

#2 kazagistar

  • Members
  • 365 posts

Posted 14 July 2012 - 04:09 AM

I did a search for split on the forums and found this: http://www.computerc...h__1#entry16317

Now, you just reassemble, by adding word by word with spaces, until you would go over 26.

#3 ChiknNuggets

  • Members
  • 130 posts

Posted 14 July 2012 - 05:12 AM

yea i had a split function that i was using and i was thinking about something like this, but i guess there isnt an easier method, ill just do it this way then





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users