Results 1 to 4 of 4

Thread: Parsing a string - Very Easy

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Tampa, FL
    Posts
    7

    Wink

    Is there a VB function I can use to parse alpha characters from a string.

    Example: String: "ARM7196"

    I need to parse ARM so that my string is equal to "7196".


  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Tampa, FL
    Posts
    7

    Wink

    Do you mean does the string always start with Alpha characters? If so, yes however there maybe alpha characters at the end of the string also. Example: "ARM7196C"


  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Code:
        Const MYSTRING = "ARM1234C"
        Dim intIndex As Integer
        Dim strNew As String
        
        For intIndex = 1 To Len(MYSTRING)
            If IsNumeric(Mid$(MYSTRING, intIndex, 1)) Then
                strNew = strNew & Mid$(MYSTRING, intIndex, 1)
            End If
        Next
        
        MsgBox strNew

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