• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Parse Strings with VBScript

I have "1, 3, 5, 15, 37" in a string called sIds.  How can I parse this string, using VBScript, to get the numbers out.  I can put them in an array and process them later or process them as they read them.
Thank you
1 Solution
You can use the split function to parse through the string and put the numbers into a string array.

It would look something like:

Dim MyString, MyArray
MyString = "1, 3, 5, 15, 37"
MyArray = Split(MyString, ", ")
' MyArray(0) = "1"
' MyArray(1) = "3"
' MyArray(2) = "5"
' MyArray(3) = "15"
' MyArray(4) = "37"

Let me know if that's what you're looking for.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now