Finding the length of a string in VBScript

Uses the len() function

Finding the length of a string in JavaScript

Uses the string.length function

Or using 3 lines of code in JavaScript versus the 5 above:

Finding a position of a substring in VB

Uses the instr() function

Using a different string

I needed to add b= to the function instr(strTTwister, " p").

The equivalent of instr() in JavaScript is the indexOf() method

VB uses the left() right() and mid() methods to return substrings

Using left()

Using right()

Using mid()

The equivalent of the above in JavaScript uses one method of substring()to return all of the above

find the length and minus 8 to get:

unlike VB the second parameter is NOT the number of characters we want returned, but the index of the position to finish chopping out the string.