Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I split a string array and display the result in a text box using vb .net?

0
Posted

How do I split a string array and display the result in a text box using vb .net?

0

Well, you said you need to use split to do this. Split takes a string to split, a delimiter to split and (optionally) an integer to limit the amount of times the string will be split and returns an array. consider this code Dim myFirstString As String Dim mySecondString As String Dim combinedString As String Dim splitstring As String() ‘ note that this is an ARRAY of strings myFirstString = “hello” mySecondString = “world” combinedString = myFirstString & ” ” & mySecondString ‘combinedString now holds “hello world” ‘ now split the string every time there is a space splitstring = Split(combinedString, ” “) MessageBox.Show(splitstring(0)) MessageBox.Show(splitstring(1)) ‘alternatively you can use a for each statement to loop through the array For Each part As String In Split(combinedString, ” “) MessageBox.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123