很抱歉,我是 C# 的新手,需要学习很多 :( 你能告诉我如何在 richtextbox 中选择用引号写的文本来帮助我吗? 就像我在调试程序时写在 richtextbox 中一样
cout<<"HELLO WORLD";
HELLO WORLD= new array
, HELLO WORLD 应该存储到一个新的数组/字符串中
最佳答案
如果您确实在使用 C#(而不是 C++,我认为您是),您可以执行以下操作:
string input = TextBox1.Text; //<--- replace Textbox1 with whatever you called your textbox
string[] txtWithNoQuotes = input.Split('"');
string noQuotes = txtWithNoQuotes[1]; // <-- this will give you Hello world, without the quotes
编辑:我觉得我的问题有点不对,如果你只想要某人在文本框中输入的文本,只需这样做
string input = NameOfYourTextbox.Text;
关于c# - 选择文本框中用双引号写的文本.. windows 窗体应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10766909/