Use Left(), Right() and Mid() to extract characters from different parts of a VBScript string.
My_string=Right(string_var, number)
number is the number of characters to return from the right side.
Dim string_var, string_part
string_var="Welcome to plus2net.com"
string_part=Right(string_var, 3)
Response.Write string_part
com
string_part=Left(string_var, 10)
Welcome to
Mid(string_var, starting_from, length)
Mid() uses a 1-based starting character position. The length argument is optional; if omitted, characters from the starting position to the end are returned.
string_var="Welcome to plus2net.com"
string_part=Mid(string_var, 12, 12)
plus2net.com
string_var="https://www.google.com"
string_part=Mid(string_var, 9, 14)
Response.Write string_part
www.google.com
www.google.com begins at position 9 in https://www.google.com.Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.