There are two javascript solutions for this,
1. String.substring(from,to)
2. String.substr(from,length)
what is the most convenient solution for vb script Mid() function
The method substr matches the usage of VB Mid function closest. The obvious difference is the the VB function takes a string as an argument, where the JS substr is a method of the string object.
string.substr(start,length)
foo = "Hello World!".substr(2, 4);
is the same as
foo = Mid("Hello World!", 2, 4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With