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

后端 未结 8 1596
故里飘歌
故里飘歌 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条回答
  •  萌比男神i
    2020-12-10 12:16

    You could do string[] parts = string.Split(' '), and then extract by the index position parts[1] and parts [3] in your example.

提交回复
热议问题