Looking for C# equivalent of scanf

Since the files are "semi-structured" can't you use a combination of ReadLine() and TryParse() methods, or the Regex class to parse your data?


If regular expressions aren't working for you, I've just posted a sscanf() replacement for .NET. The code can be viewed and downloaded at http://www.blackbeltcoder.com/Articles/strings/a-sscanf-replacement-for-net.


You can use scanf directly from C runtime libraries, but this can be difficult if you need to run it with different parameters count. I recommend you to regular expressions for you task or describe that task here, maybe there is another ways.

Tags:

C#

Scanf