Results 1 to 7 of 7

Thread: Split problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2002
    Location
    Belgium
    Posts
    190

    Split problem

    I have a textbox with a lot off words and spaces with a length from about
    200 charaters and spaces

    i need to spilt them in lengths from about 50 chrs
    i want to have a vbcrlf between this lengths

    can someone thel my how to do that

    Thanks in advance

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Use mid(stringname,1,50) to get splits of 50.
    TO add the vbCrlf, simply put

    finalstring = mid(stringname,1,50) & vbCrlf & mid(stringname,51,100) & vbCrlf & mid(stringname,101,150) & vbcrl & mid(stringname,151,200) & vbcrl


    Now, you'll have to piece it together because I couldn't understand exactly what you're looking for.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    You should also consider posting in the General VB forums.

  4. #4
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Probably get more awnsers there.....

  5. #5
    Banned Michael_Kamen's Avatar
    Join Date
    May 2001
    Location
    The Netherlands
    Posts
    1,180
    Originally posted by mendhak

    Now, you'll have to piece it together because I couldn't understand exactly what you're looking for.
    I think he wants lines of 50 characters in a textbox

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by Michael_Kamen
    I think he wants lines of 50 characters in a textbox
    Give him the answer, man.

  7. #7
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    For x = 1 to len(text) step 50
    result = result & mid$(text,x,50) & vbnewline
    next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width