Alex Rivera | Logout

C# equivalent of C sscanf

Asked 2010-11-19T10:02:13.113
29

Possible Duplicate:
Is there an equivalent to 'sscanf()' in .NET?

sscanf in C is a nice way to read well formatted input from a string.

How to achieve this C#.

For example,

int a,b;
char *str= "10 12";
sscanf(str,"%d %d",&a,&b);

The above code will assign 10 to a and 12 to b.

How to achieve the same using C#?

Edit
Report

1 Answer

1

from Run-Time Routines and .NET Framework Equivalents

sscanf, swscanf ==> See Parse methods, such as System.Double.Parse

So, I guess there's no direct equivalent.

answered 2010-11-19T10:17:05.327

Your Answer