Results 1 to 4 of 4

Thread: String Maipulation

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    I would like to grab every character in a combo box until the first space. How would I do that, left, mid, trim???

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Try this:
    Code:
    Dim sTextUpToSpace As String
    Dim lSpacePos As Long
    
    sTextUpToSpace = MyComboBox.Text
    lSpacePos = InStr(sTextUpToSpace, " ")
    If lSpacePos Then sTextUpToSpace = Left(sTextUpToSpace, lSpacePos - 1)
    
    ' Now use sTextUpToSpace.
    Enjoy!

  3. #3
    Guest
    Code:
    Dim Str As String
    Str = Left$(Trim$(Combo1.Text), InStr(1, Combo1.Text, " "))
    Print Str

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    In VB6
    Dim Str As Variant
    Str = Combo1.Text
    Str = Split(Str, " ")
    MsgBox Str(o)
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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