1

I have this fun sscanf function call I need to convert to C#:

u_sscanf(tag.c_str(), "%*[<]%[^<>=:!]%[<>=:!]%[-.MAXIN0-9]%*[>]", tkey, top, txval)

How would I best go about this? Are there any libraries that can help me?

HelloWorld
  • 3,381
  • 5
  • 32
  • 58
  • 2
    There are two ways you can challenge this monster without any library. You do not want to hear both probably as one is "manual parsing" (as some help: translate the above to some `Regex` and just pass whatever `Console.ReadLine()` passes to you) and the second one involves `DllImport` and a little bit of unsafe code – X39 Jun 05 '19 at 09:58
  • Possible duplicate of [Looking for C# equivalent of scanf](https://stackoverflow.com/questions/472202/looking-for-c-sharp-equivalent-of-scanf) – X39 Jun 05 '19 at 09:59
  • @X39 that's what I was thinking as well. pinvoking is not an option though. – HelloWorld Jun 05 '19 at 10:46

0 Answers0