Results 1 to 3 of 3

Thread: Need a FUNCTION...help!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Location
    Utah, USA
    Posts
    353

    Need a FUNCTION...help!

    Is there a function in VB.NET to test to see if a variable like 'WholeName' contains anyspaces in it or not? Please help fast!

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Use IndexOf method
    VB Code:
    1. Dim var1 As String = "A Test"
    2. Dim pos As Integer
    3.  
    4. pos = var1.IndexOf(" ")
    5.  
    6. If pos > 0 Then
    7.    'There is a space in the string
    8. Else
    9.    'There is not a space in the string
    10. End If
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Location
    Utah, USA
    Posts
    353
    I LOVE YOU! Thanks for your help. It works perfect!

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