I need to use VBScript to insert an "and" into a string before the last item in a comma-separated list.
strList = "512, 66, 1820, 1235, 7, 4918"
needs to become...
strReList = "512, 66, 1820, 1235, 7 and 4918"
I've looked around SO and have found this question answered for javascript, C# and other languages, but never VBS.
This can be achieved with the
StrReverse()andReplace()functions:Output: