splitting arrays

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike D

    splitting arrays

    I have a string that looks like this: a|b|c|d%e|f| ...

    I split once on "%"

    ar1 = Split(Mystring, "%")

    then when I try and split the ar1 by

    ar2 = Split(ar1, "|")

    I get error '800a000d' Type mismatch

    I have tried
    ar2 = Split(Cstr(ar1) , "|")

    How can I split this string?

    Thanks
    Mike

  • Bob Lehmann

    #2
    Re: splitting arrays

    ar2 = split(ar1(0), "|")

    You will probably want to loop through ar1 instead of writing each one out
    though.

    Bob Lehmann

    "Mike D" <MikeD@discussi ons.microsoft.c om> wrote in message
    news:C2777E0C-9C00-4DEB-8238-447DFBF39C9F@mi crosoft.com...[color=blue]
    > I have a string that looks like this: a|b|c|d%e|f| ...
    >
    > I split once on "%"
    >
    > ar1 = Split(Mystring, "%")
    >
    > then when I try and split the ar1 by
    >
    > ar2 = Split(ar1, "|")
    >
    > I get error '800a000d' Type mismatch
    >
    > I have tried
    > ar2 = Split(Cstr(ar1) , "|")
    >
    > How can I split this string?
    >
    > Thanks
    > Mike
    >[/color]


    Comment

    • Mike D

      #3
      Re: splitting arrays

      Thanks. It's been a hard Monday.

      Mike

      "Bob Lehmann" wrote:
      [color=blue]
      > ar2 = split(ar1(0), "|")
      >
      > You will probably want to loop through ar1 instead of writing each one out
      > though.
      >
      > Bob Lehmann
      >
      > "Mike D" <MikeD@discussi ons.microsoft.c om> wrote in message
      > news:C2777E0C-9C00-4DEB-8238-447DFBF39C9F@mi crosoft.com...[color=green]
      > > I have a string that looks like this: a|b|c|d%e|f| ...
      > >
      > > I split once on "%"
      > >
      > > ar1 = Split(Mystring, "%")
      > >
      > > then when I try and split the ar1 by
      > >
      > > ar2 = Split(ar1, "|")
      > >
      > > I get error '800a000d' Type mismatch
      > >
      > > I have tried
      > > ar2 = Split(Cstr(ar1) , "|")
      > >
      > > How can I split this string?
      > >
      > > Thanks
      > > Mike
      > >[/color]
      >
      >
      >[/color]

      Comment

      Working...