如何删除文本框中int的某些部分 [英] how to remove certain parts of int in textbox
本文介绍了如何删除文本框中int的某些部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我有一点问题
文本框中的
我有这个数字
,1,,2,4,,6,8,
就像我写的一样
我要删除2,这样
,1,4,,6,8,留在文本框中
但通过代码
不是通过选择
我试过文本框。 Text = textbox.Text.Remove(,2,);
但不好
任何帮助请
解决方案
我不知道你的目的是什么,但是使用String.Replace [ ^ ]。
textbox.Text = textbox.Text.Replace(< span class =code-string> ,2,,串跨度> .Empty);
Hello
I have a little problem
in textbox I have this numbers
,1,,2,,4,,6,,8,
exactly like I have written it
and I want to remove ,2, so that
,1,,4,,6,,8, stays in textbox
but thru code
not by selection
I have tried textbox.Text = textbox.Text.Remove(",2,");
but its not good
any help please
解决方案
I don''t know what is your purpose with all this, but use String.Replace[^].
textbox.Text = textbox.Text.Replace(",2,",string.Empty);
这篇关于如何删除文本框中int的某些部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文