Results 1 to 6 of 6

Thread: Simple Replace (Resolved)

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Simple Replace (Resolved)

    i have a list of words in list1 that all have spaces at the end. and i want to remove the spaces. But keep them in the same list box.

    Thanks.
    Last edited by Ricky1; Oct 7th, 2005 at 12:44 PM.
    Im Learning !!!!

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Re: Simple Replace

    just spaces at the end. No where else.
    Im Learning !!!!

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Simple Replace

    Use Trim when you add them to the listbox.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Re: Simple Replace

    wouldn't trim remove the last letter no matter what it was? because not all the words do have spaces at the end.
    Im Learning !!!!

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Re: Simple Replace

    Code:
    If Right(list1.list(i), 1) = " " Then
        list1.list(i) = list1.list(i) - Right(list1.list(i)
    End If
    Soemthing like that ??
    Im Learning !!!!

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Simple Replace

    LTrim removes leading spaces, RTrim removes trailing spaces and Trim removes both.

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