anonamas
anonamas

Reputation: 241

VBSCRIPT Split String

How can I split a string using vbscript?

Dim personal_number
Dim personal_prefix

person_prefix = Split(personal_number, 4)

I want to split person_prefix and grab the first four characters. Is this the correct approach because it seems to return the entire string on document.write.

Upvotes: 1

Views: 3884

Answers (1)

Bathsheba
Bathsheba

Reputation: 234715

To return the first four characters use person_prefix = Left(personal_number, 4) instead.

(String splitting breaks up a string into an array using a supplied delimiter: not relevant in your case).

Upvotes: 3

Related Questions