Re: Parsing arguments foo:bar foo:bar foo:bar
- From: Pavel Minaev <int19h@xxxxxxxxx>
- Date: Tue, 10 Feb 2009 14:42:15 -0800 (PST)
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.
.
- References:
- Parsing arguments foo:bar foo:bar foo:bar
- From: puzzlecracker
- Parsing arguments foo:bar foo:bar foo:bar
- Prev by Date: Re: easy question about comparing collection using var in LINQ
- Next by Date: Re: easy question about comparing collection using var in LINQ
- Previous by thread: Parsing arguments foo:bar foo:bar foo:bar
- Index(es):
Relevant Pages
|