Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    123

    Unanswered: Parse string variable

    Is there a fairly simple way to parse a string variable if I know the separator is a certain character, say "|"?

    Example string: "New|300|14.5|null|9/22/07|Y"

  2. #2
    Join Date
    Nov 2002
    Posts
    272
    Look up the Split() function. It will turn your string into an array.

  3. #3
    Join Date
    Aug 2003
    Posts
    123
    Thanks. Are there any examples of how to use it? Access help seems sparse.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Here's a quick one for you
    Code:
    Dim x As Variant
    Dim y As Integer
    
        x = Split("a|b|c|d|e|fghij", "|")
        
        For y = 0 To UBound(x)
            Debug.Print x(y)
        Next
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •