Re: Parsing arguments foo:bar foo:bar foo:bar



On Feb 10, 2:00 pm, puzzlecracker <ironsel2...@xxxxxxxxx> wrote:
array args of string internally looks like this, free spacing is
assumed:  foo:bar foo1:bar foo2:bar2 ...etc.  I need to quickly parse
the array  into  two strings each contaning foo and bar,

Do you perhaps mean "parse the array into two arrays of strings, one
for all 'foo', another for all 'bar'"? Otherwise it doesn't make much
sense to me, unless you want to ignore everything after "foo:bar" in
the input string.

Otherwise, what exactly is the problem? Use String.Split to split into
name-value pairs, then Split on each in turn to separate names and
values; add both to the corresponding List<string> instances, and
that's it.
.



Relevant Pages

  • Parsing a string into a hash
    ... I have some strings like this: ... my $str = "Array ... I want to be able to parse that string into a Perl hash where the keys are ...
    (comp.lang.perl.misc)
  • Re: Checking if two FILE *s are associated with the same stream.
    ... >> I have an array of strings containing filenames. ... >> and parse the data within. ...
    (comp.lang.c)
  • Re: K&R2 Secition 5.9 - major blunders
    ... Each element of b doesn't point to a 20 element array of int. ... This mistake is crucial because ... my explanation is really the qualities of something else: ... > The use of the array of pointers is to store the strings. ...
    (comp.lang.c)
  • Re: K&R2 Secition 5.9 - major blunders
    ... Each element of b doesn't point to a 20 element array of int. ... This mistake is crucial because ... my explanation is really the qualities of something else: ... > The use of the array of pointers is to store the strings. ...
    (comp.lang.c)
  • Re: Returning array of strings through callback from unmanaged to
    ... Is the array of strings a jagged array or fixed length array? ... It is imperative that I am able to return the array of strings from the ... I have control over how many strings I want the unmanaged code to return ... What I want to accomplish is to pass a callback function to unmanaged ...
    (microsoft.public.dotnet.framework.compactframework)