Parsing strings to objects (techniques)

  • Thread starter Thread starter Cesar Ronchese
  • Start date Start date
C

Cesar Ronchese

Hi All.

I need to parse a command-line string and transform results in some objects.
For sample:

myapp.exe /param1="textwith""quotes" /param2=other text /param3=123
...will become:
objParam("param1").Value = "textwith""quotes"
objParam("param2").Value = "other text"
objParam("param3").Value = "123"

Note the double quotes in the text. I need to recognize that as a simple
quote, like SQL do.

What I really need is about techniques or a specific class for do that work,
because that string can be huge and very complicated, according the context.

Any suggestion?

Cesar
 
Cesar said:
Hi All.

I need to parse a command-line string and transform results in some objects.
For sample:

myapp.exe /param1="textwith""quotes" /param2=other text /param3=123
...will become:
objParam("param1").Value = "textwith""quotes"
objParam("param2").Value = "other text"
objParam("param3").Value = "123"

Note the double quotes in the text. I need to recognize that as a simple
quote, like SQL do.

What I really need is about techniques or a specific class for do that work,
because that string can be huge and very complicated, according the
context.

Read up in the MSDN on Regular Expressions (all the stuff in the
namespace System.Text.RegularExpressions). Feel free to come back with
more specific questions :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top