String function

They have: 39 posts

Joined: Jun 2000

How do you get a substring from string? e.g.
string2 = "Student@School@City"
in this case student is separated from scool by "@" character

Ho do I get student from string2 using VBScript ot JavaScript?

Thanks

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Using what language?

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

Well if the separating character is always going to be an '@' then in VBScript you could use something like:

string2 = "Student@School@City"
EndAt = InStr(1,string2,"@") - 1
FinalString = Mid(string2,1,EndAt)

PJ | Are we there yet?
pjboettcher.com

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.