Splitting string over word boundry

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Splitting string over word boundry

    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


  • zacks@construction-imaging.com

    #2
    Re: Splitting string over word boundry

    On May 7, 8:52 am, "John" <i...@nospam.in fovis.co.ukwrot e:
    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.

    Comment

    • John

      #3
      Re: Splitting string over word boundry

      but how to ensure each split is upto 160 characters?

      <zacks@construc tion-imaging.comwrot e in message
      news:93de7f45-cd58-4b0e-b2af-8943535f3c5e@i7 6g2000hsf.googl egroups.com...
      On May 7, 8:52 am, "John" <i...@nospam.in fovis.co.ukwrot e:
      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.


      Comment

      • Armin Zingler

        #4
        Re: Splitting string over word boundry

        "John" <info@nospam.in fovis.co.ukschr ieb
        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

        Comment

        • zacks@construction-imaging.com

          #5
          Re: Splitting string over word boundry

          On May 7, 9:26 am, "John" <i...@nospam.in fovis.co.ukwrot e:
          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...@construc tion-imaging.comwrot e in message
          >
          news:93de7f45-cd58-4b0e-b2af-8943535f3c5e@i7 6g2000hsf.googl egroups.com...
          On May 7, 8:52 am, "John" <i...@nospam.in fovis.co.ukwrot e:
          >
          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.

          Comment

          Working...