views:

810

answers:

2

Is there a substring() function in VBScript similar to Java's string.substring()?

+5  A: 

Yes, Mid.

Dim sub_str
sub_str = Mid(source_str, 10, 5)

The first parameter is the source string, the second is the start index, and the third is the length.

Tmdean
+2  A: 

As Tmdean correctly pointed out you can use the Mid() function. The MSDN Library also has a great reference section on VBScript which you can find here:

VBScript Language Reference (MSDN Library)

Kev