Hello, I am new to VBscripting and hope someone can help clarify the split options. I just started learning VBscrpiting a few weeks ago and Im trying to figure out how to do something. I haven't learned anything other than the basics so this question might seem super simple.

If I have an inputbox and lets say I punch in a string consisting of this... test,script!are:Awsome@

and I wanted the following message box to split apart my line piece by piece.. I want to give an explaination message of each word. I figured out how to split them, but I cant figure out how to split with different symbols then display a message with them. for example if I was trying to brake a web address up or something I would need to split the domain: from the hostname// and the hostname from the Toplevel domain (.) and explain each part seperatly, but they are seperated by different characters.. like : / .

I want to input a line then display a msgbox that contains a description of each split. like this.

test,script!are:Awsome@

Test = a series of questions or exercises
script = an original or principal instrument or document
are = to include
Awesome = expressive of awe

Basically I am trying to pull apart an input, display it in a message box and define it as well. seems simple, but turns out I can figure out the split function.

Let's take the string "http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/463764/super-easy-one..-i-hope". If we assign that to the variable s, then do

f = Split(s,"/")

then

f(0) = "http:"
f(1) = ""
f(2) = "www.daniweb.com"
f(3) = "software-development"
etc.

We can similarly split f(2) using "." as the split character to get the dotted elements of the domain.

Ok So.. I tried to play around with it for a while. What I have gotten is a message box to pop up with the split in it seperatly.

meaning it would pop several messages message then go away.

http
www.daniweb.com
software-development.

Then go away.

here is what I used.

inputText = Urllnk
outputstring = split(inputText,":", -1, 1)
for each x in outputstring
message = message & x & vbCRLF
next
msgbox message`

So my end goal is to have it pop up in one message box and say

http is The protocol
www is the server
daniweb is The website name
.com is the top level domain
software-development is The path

So I Know I will need to have more splits later, but once I get this first one going I should be good.
I thank you so much for your advise!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.