SolvedString Splitting

Posts 1–6 of 6 · Page 1 of 1
String Splitting
Hello,



Okey so here is the deal. The program task is to take 50 codes including letters and numbers. Take them and insert them into a webpage(webbrowser1) witch is designed to deal with these codes(3 fields). To check if the codes is valid etc.

Here is what I got :

Code:
WebBrowser1.document.GetElementById("Website textbox ID here").SetAttribute("value", TextBox1.Text) ' 

WebBrowser1.document.GetElementById("Website textbox ID here").SetAttribute("value", TextBox2.Text) '

WebBrowser1.document.GetElementById("Website textbox ID here").SetAttribute("value", TextBox3.Text) '
What this does it takes textbox1.text input(first part of code) and inserts in the first field at the website.

The to others to exactly the same.

But instead of having 3 diffrent texboxes I want it like in this pic.



If you don't understand what I'm trying to do, just ask!
Split the string?
Quote Originally Posted by Blubb1337 View Post
Split the string?
Does that work?

I don't really know how to split a string, or actually I don't knw mutch about strings in the first place

I will read about it and learn =)

If you could give me an example it would be great.

#Thanked
Quote Originally Posted by gamernuub View Post
Does that work?

I don't really know how to split a string, or actually I don't knw mutch about strings in the first place

I will read about it and learn =)

If you could give me an example it would be great.

#Thanked
Code:
Dim Example as string = "code1 code2 code3"

Dim codes() as string = Split(Example," ")

for i = 0 to codes.length - 1
msgbox(codes(i))
next
If you want to have the three codes per row you may do the following aswell.

Code:
for i = 0 to codes.length - 3 step 3
msgbox(codes(i))
msgbox(codes(i+1))
msgbox(codes(i+2))
next
Or....

Code:
Dim Example as string = "code1 code2 code3
code4 code5 code6"

Dim c() as string = Split(Example,vbnewline)

for i = 0 to c.length - 1
dim codes() as string = Split(c(i)," ")

msgbox(codes(0))
msgbox(codes(1))
msgbox(codes(2))
next
@gamernuub
Quote Originally Posted by Blubb1337 View Post
Code:
Dim Example as string = "code1 code2 code3"

Dim codes() as string = Split(Example," ")

for i = 0 to codes.length - 1
msgbox(codes(i))
next
If you want to have the three codes per row you may do the following aswell.

Code:
for i = 0 to codes.length - 3 step 3
msgbox(codes(i))
msgbox(codes(i+1))
msgbox(codes(i+2))
next
Or....

Code:
Dim Example as string = "code1 code2 code3
code4 code5 code6"

Dim c() as string = Split(Example,vbnewline)

for i = 0 to c.length - 1
dim codes() as string = Split(c(i)," ")

msgbox(codes(0))
msgbox(codes(1))
msgbox(codes(2))
next
@gamernuub
@Blubb1337

Thank you so much dude, my program works perfectly !

#Thanked and thanks for the help everyone!
In My Opinion, Comma delimited is the way to go. It gives a "static" place to check for breaks.

Code1,Code2,Code3

instead of

Code1 Code2 Code3
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us