本文介绍了在字符串的结尾修剪字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我想从我的句子在C#中删除的最后一个字。这里是我的查询:
选择*从不同人的城市= @city,县= @County AND
我想删除最后也是编程,我该怎么办呢?
谢谢
解决方案
VAR的查询=SELECT * FROM WHERE人=城和@city县= @County AND;
变种擦洗= query.Substring(0,query.Length - 4);
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"
I want to remove the last AND programatically, how can I do that?Thanks
解决方案
var query = "SELECT * FROM People WHERE City = @City AND County = @County AND";
var scrubbed = query.Substring(0, query.Length - 4);
这篇关于在字符串的结尾修剪字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!