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

后端 未结 8 1593
故里飘歌
故里飘歌 2020-12-10 11:46

The .NET Framework gives us the Format method:

string s = string.Format(\"This {0} very {1}.\", \"is\", \"funny\");
// s is now: \"This is very funny.\"
         


        
8条回答
  •  情深已故
    2020-12-10 12:33

    Yep. These are called "regular expressions". The one that will do the thing is

    This (?.+) very (?.+)\.
    

提交回复
热议问题