trim string at the end of the string

前端 未结 6 821
时光说笑
时光说笑 2021-01-16 07:01

Hello I want to remove the last word from my sentence in C#. Here is my query:

\"SELECT * FROM People WHERE City = @City AND County = @County AND\"
         


        
6条回答
  •  渐次进展
    2021-01-16 07:20

    var query = "SELECT * FROM People WHERE City = @City AND County = @County AND";
    var scrubbed = query.Substring(0, query.Length - 4);
    

提交回复
热议问题