问题描述
我有一个可以测试某些方法的应用程序.
在我的"TestApp"中,我有4个按钮:btnTekst,btnSplit,btnMid和btnUbound.
我还有4个文本框:txtTekst,txtSplit,txtMid和txtUbound.
我要做的第一件事是在第一个文本框中显示整个tekst.这很容易做到.第二件事是像这样分割tekst:
I have an App to test some methods.
In my "TestApp" I have 4 buttons: btnTekst, btnSplit, btnMid and btnUbound.
I have also 4 Textboxes: txtTekst, txtSplit, txtMid and txtUbound.
First thing I want to do is the whole tekst showing in the first Textbox. This is easy to do. Second thing is to split the tekst like this:
Public Class frmTestApp
Private Sub frmTestApp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
End Sub
Private Sub btnTekst_Click(sender As System.Object, e As System.EventArgs) _
Handles btnTekst.Click
txtTekst.Text = "ADR;WORK;PREF:;;Straat 01;Plaats;;Postcode"
Dim txt As String = txtTekst.Text
Dim newTxtStrings As New List(Of String)
'newTxtStrings = txt.Substring(txt.IndexOf(":") + 1).Split(";").Where(Function(txtString)
' Return txtString.Length > 0
' End Function).ToList
End Sub
Private Sub btnSplit_Click(sender As System.Object, e As System.EventArgs) _
Handles btnSplit.Click
End Sub
Private Sub btnMid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnMid.Click
txtMid.Text = txtTekst.Text
End Sub
Private Sub btnUbound_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnUbound.Click
txtUbound.Text = txtTekst.Text
End Sub
End Class
你她我上面的代码.我想将文本bij:"和;" ..分开.我早些时候曾问过这个问题,但它仍然无法正常工作.
如果已拆分,我想在第三个文本框中输入Mid.
之后,我想使用Ubound,但是也许我不需要最后一个功能.
每个人都可以帮我吗?
You she my code above. I want to split the text bij ":" and ";"..I have asked this earlier, but it''s still not working as it should be.
If this is split, I want to Mid in the third textbox.
After that I want to use Ubound, but mabey I don''t need the last function.
Can everyone help me out?
thanks!
推荐答案
这篇关于分裂并再次中间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!