How to get substring from string in c#?

前端 未结 7 1563
夕颜
夕颜 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条回答
  •  萌比男神i
    2020-12-16 12:36

    Here is example of getting substring from 14 character to end of string. You can modify it to fit your needs

    string text = "Retrieves a substring from this instance. The substring starts at a specified character position.";
    //get substring where 14 is start index
    string substring = text.Substring(14);
    

提交回复
热议问题