creating a line break after 5 words

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drosberg
    New Member
    • Mar 2013
    • 3

    creating a line break after 5 words

    Hi all, I've created a form with a memo field where enter text in an unformatted format. I would like to add a second field to the form which takes this text and forces a line break after five words, continues with a second sentence of 5 words, 3rd, etc. I've looked through the text string functions and some examples but I'm stuck.

    Any suggestions would be greatly appreciated.

    Don
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please show us the code where you're stuck.

    Comment

    • drosberg
      New Member
      • Mar 2013
      • 3

      #3
      Actually I'm looking for code examples that might work. Just aa beginner.

      Thanks

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        This isn't a code writing service but if you post the code you've tried, we can help guide you to an answer.

        Comment

        • drosberg
          New Member
          • Mar 2013
          • 3

          #5
          Not quite sure where to start so I will see if I can find an example.

          Thanks so much for your help. What a useful forum.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            Start with the code you've already tried. Post that and we can see where you went wrong. You said you already tried some string functions and examples so start by posting those.

            Please hold the sarcasm. We are here to teach you to fish. Not give you fish. If you're not here to learn, then what are you here for?

            Comment

            • sharmajv
              New Member
              • Apr 2013
              • 11

              #7
              Code:
              array1 = Split(memo field," ") 
              WRD_CNT = Ubound(array1) 
              
              If WRD_CNT = 5 then
                 Response.Write "</br>"
              Else
              End If
              Take a Start Counter of 1 and increment using For Loop..When Counter Reaches 5 make it 1 again..Put the above Code in the For Loop
              Last edited by Rabbit; Apr 5 '13, 04:26 PM. Reason: Please use code tags when posting code.

              Comment

              Working...