How to get substring from string in c#?

前端 未结 7 1554
夕颜
夕颜 2020-12-16 12:09

I have a large string and its stored in a string variable str. And i want to get a substring from that in c#? Suppose the string is : \" Retrieves a substring from thi

相关标签:
7条回答
  • 2020-12-16 12:50
    string newString = str.Substring(0,10)
    

    will give you the first 10 characters (from position 0 to position 9).

    See here.

    0 讨论(0)
提交回复
热议问题