Results 1 to 5 of 5

Thread: String manipulation

  1. #1

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674

    String manipulation

    At some point in my app I'm adding to a listbox a string like so:
    VB Code:
    1. lstW1.AddItem Text1 & "[I]spaces go here[/I]" & Text2 & "-" & Text3
    I have 16 spaces for characters so I calculate how many blank spaces I need like so:
    VB Code:
    1. iSpaces = 16 - (Len(Text1) + Len(Text2) + Len(Text3))
    This leaves me with how many spaces I need to insert between Text1 and Text2, my trouble is
    I can't figure out how to add these spaces.

    Any help is appreciated:
    "I have not failed. I've just found 10,000 ways that won't work."
    'Thomas Edison'

    "If we knew what it was we were doing it wouldn't be called research, would it?"
    'Albert Einstein'

    VB6

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. lstW1.AddItem Text1 & Space(iSpaces) & Text2 & "-" & Text3
    -= a peet post =-

  3. #3

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    I got it - Thanks for reading though!
    "I have not failed. I've just found 10,000 ways that won't work."
    'Thomas Edison'

    "If we knew what it was we were doing it wouldn't be called research, would it?"
    'Albert Einstein'

    VB6

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    your toooooo slow
    -= a peet post =-

  5. #5

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    Hey - your code turned out to be better anyway!!

    Thanks,
    slowpoke
    "I have not failed. I've just found 10,000 ways that won't work."
    'Thomas Edison'

    "If we knew what it was we were doing it wouldn't be called research, would it?"
    'Albert Einstein'

    VB6

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