VB.NET Help - String manipulation

Discussion in 'Computing, Science, and Technology' started by Gatzy118, Sep 17, 2008.

  1. Gatzy118

    Gatzy118 New Member

    Joined:
    Jan 7, 2008
    Messages:
    350
    Likes Received:
    0
    Device:
    iPod touch
    hey guys, I was wondering if there was a way in vb.net to test if a string begins with a letter or a number. I have searched but there may be a way. Thanks guys, Gatzy118
  2. simonrichards150

    simonrichards150 New Member

    Joined:
    Oct 29, 2007
    Messages:
    2,058
    Likes Received:
    94
    Device:
    iPod touch
    Use this

    Code:
    If Text(0) = "A" Then
    Do Something
    Else
    Do Something Else
    Endif
    Change the A to whatever letter you are checking for. Index 0 of a string is the first character of the string.
  3. Gatzy118

    Gatzy118 New Member

    Joined:
    Jan 7, 2008
    Messages:
    350
    Likes Received:
    0
    Device:
    iPod touch
    I've found a solution! If Asc(string) - 48 <= 9 then
    Etc!!! For numbers

Share This Page