Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Distinguishing if data is a string

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Resolved [RESOLVED] [2005] Distinguishing if data is a string

    Hi Everyone,

    I am pulling data from a text file on my local machine. My problem is that is each line of data could be an alphanumeric string, or just a pure integer string. (I only want to import the integer string)

    How can I programmaticaly differentiate each line in the text file over being alpha numeric or integer?

    Below is an example of the lines in my text file:

    9585632
    This is a test 4562
    9653
    548 Blah Blah Blah
    In the above example, I would only like to import the integer lines. So the program should only grab 9585632 and 9653

  2. #2
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: [2005] Distinguishing if data is a string

    Code:
    Dim intResult As Integer
    If Integer.TryParse("LINE TO CHECK", intResult) Then
        'Do Something
    End If
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    250

    Re: [2005] Distinguishing if data is a string

    Thanks bmahler,

    It works perfectly.

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