Results 1 to 6 of 6

Thread: variable

  1. #1

    Thread Starter
    Addicted Member Sanj's Avatar
    Join Date
    Apr 2001
    Location
    in front of my PC
    Posts
    242

    variable

    pls need quick help

    i have a variable that contains the words "Hello World" for example

    how can i "point" to any given charater in that variable???

    This must be posible pls help!


    regards
    Sanj

  2. #2
    sunnyl
    Guest
    You can use the Mid function, which will return any character starting from any point in the string for a specified length.

    VB Code:
    1. Dim DataToGetFrom As String
    2.  
    3. returned = Mid(DataToGetFrom, StartFrom, LengthToGetFor)

  3. #3
    Frenzied Member Skitchen8's Avatar
    Join Date
    Feb 2001
    Location
    Binghamotn, NY
    Posts
    1,943
    or use instr to find the pos of a certain character, or use the like statement
    Government is another way to say better…than…you.
    It’s like ice but no pick, a murder charge that won’t stick,
    it’s like a whole other world where you can smell the food,
    but you can’t touch the silverware.
    Huh, what luck. Fascism you can vote for.
    Humph, isn’t that sweet?
    And we’re all gonna die some day, because that’s the American way
    -Stone Sour

  4. #4
    Fanatic Member Bonker Gudd's Avatar
    Join Date
    Mar 2000
    Location
    Saturn
    Posts
    748
    mid$(String, n, 1) gives the character at the nth position

  5. #5
    Addicted Member Screamager's Avatar
    Join Date
    May 2001
    Location
    Dublin, Ireland
    Posts
    174
    Use Mid? Mid("Hello World",2,1) would return 'e'...
    Computer /nm./: a device designed to speed and automate errors

  6. #6

    Thread Starter
    Addicted Member Sanj's Avatar
    Join Date
    Apr 2001
    Location
    in front of my PC
    Posts
    242
    cheers guys

    i think the mid function should work! forgot about that one
    Sanj

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