sscanf functionallity in C#

In C/C++ there is the possibilty to parse strings using the sscanf function. This is neat since you then have the possibility to match complete patterns of text, instead of manually having to parse through every single character in a string.

There must be some easy way to do this i C# also (since I think a lot of people would use this kind of functionallity) but I haven't figured it out yet. Does anyone have any tips/examples?
RoboRogerAsked:
Who is Participating?
 
xloopCommented:

I believe the Format function is equivelant to sscanf.

String.Format
String.Substring
String.Split
String.Parse

All in msdn

Good luck
0
 
CJ_SCommented:
String namespace also contains support for regular expressions. Easy for validation!

CJ
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
RoboRogerAuthor Commented:
Does anyone have any good examples for how to use the regual expressions?
0
 
CJ_SCommented:
Several. Lots can be found if you do a search on "regaular expressions C#"

http://www.c-sharpcorner.com/3/RegExpPSD.asp

CJ
0
 
CJ_SCommented:
First come first serve instead of first idea first serve?

*sigh*
0
 
RoboRogerAuthor Commented:
Sorry CJ_S, but your original answer wasn't good enough (I've allready tried that), and I always promote quick answers....

(You where pretty fast too though....)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.