How to remove first and last character of a string in C#?

后端 未结 4 1171
醉酒成梦
醉酒成梦 2021-02-12 13:38
String: \"hello to the very tall person I am about to meet\"

What I want it to become is this:

String: hello to the very tall person I          


        
4条回答
  •  耶瑟儿~
    2021-02-12 14:01

    Use the String.Substring method.

    So, if your string is stored in a variable mystr, do as such:

    mystr = mystr.Substring(1, mystr.Length - 2);
    

提交回复
热议问题