Tom S
Tom S

Reputation: 165

How to build javascript string so vbScript Split will split it back apart into an array?

Do I need Carriage Returns (not familiar with it)? Currently this is how my JavaScript string is being built:

allcars = cars + makes;

Unfortunately, when I get to my Split function call (that I rather should not change), it does not split my JavaString back apart into an array:

CarsList = Split(Request("allcars"),vbCrLf)

When the Split function call gets string coming from a different source, it splits such string correctly (unlike with string from my JavaScript function).

Upvotes: 1

Views: 88

Answers (1)

Wiktor Stribiżew
Wiktor Stribiżew

Reputation: 626851

The vbCrLf constant represents a sequence of CR (carriage return, \r) and LF (line feed, \n) symbols. So, use

allcars = cars + "\r\n" + makes;

Upvotes: 1

Related Questions