Vb.net 如何拆分文本框值,然后在标签上显示拆分后的值
如何拆分文本框(以“-”分隔)值,然后在两个标签上显示拆分后的值 这是我的密码:Vb.net 如何拆分文本框值,然后在标签上显示拆分后的值,vb.net,visual-studio-2010,.net-4.0,Vb.net,Visual Studio 2010,.net 4.0,如何拆分文本框(以“-”分隔)值,然后在两个标签上显示拆分后的值 这是我的密码: Dim s As String Dim substring As String Dim sp() As String s = txtTime1.Text 'this text box contains value (08:00-17:41) sp = s.Split("-") For Each substring In sp txtTimeIn.T
Dim s As String
Dim substring As String
Dim sp() As String
s = txtTime1.Text 'this text box contains value (08:00-17:41)
sp = s.Split("-")
For Each substring In sp
txtTimeIn.Text = substring
txtTimeOut.Text = substring
Next
我的问题是txtTimeIn和txtTimeOut只显示值“17:41”。提前非常感谢。试试这个:
Dim s As String
Dim substring As String
Dim sp() As String
s = txtTime1.Text 'this text box contains value (08:00-17:41)
sp = s.Split("-")
txtTimeIn.Text = sp(0)
txtTimeOut.Text = sp(1)
我做了更多的研究:)这是未来研究人员的链接,干杯,兄弟!