Looking for C# equivalent of scanf

后端 未结 9 1150
误落风尘
误落风尘 2020-11-29 09:51

I used to code in C language in the past and I found the scanf function very useful. Unfortunately, there is no equivalent in C#.

I am using using it to

9条回答
  •  广开言路
    2020-11-29 10:40

    There is good reason why a scanf like function is missing from c#. It's very prone to error, and not flexible. Using Regex is much more flexible and powerful.

    Another benefit is that it's easier to reuse throughout your code if you need to parse the same thing in different parts of the code.

提交回复
热议问题