本文介绍了文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我有一个文本框,我的文本框值是这样的A1 A2 A3 A4 A5
我想一个接一个地取这个值并分配给某个字符串变量,该怎么办?
在Advance中感谢
Hi in form i have text box, my textbox values is like this A1 A2 A3 A4 A5
I want to take this value''s one by one and assign to some string variable, how shall I do?
Thanks in Advance
推荐答案
Dim strValue As String = "A1 A2 A3 A4 A5 F"
Dim strTem As String
strTem = String.Empty
Dim i As Integer
For i = 0 To strValue.Length - 1
strTem += strValue.Substring(i, 1)
Next
谢谢,
Mamun
Thanks,
Mamun
string l = String.Empty;
string[] arr = textbox1.text.Split(' ');
for (int i = 0; i <= arr.Length ;i++ )
{
l = l + arr[i];
}
抱歉,我的回答是在C#中,但是您可以在VB.Net中使用类似的概念.
Apologies my answer is in C#, but you can use a similar concept in VB.Net.
这篇关于文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!