Sample code for 30+ languages & platforms
VBScript

StringBuilder GetAfterBetween

Demonstrates the GetAfterBetween method.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

set sb = CreateObject("Chilkat.StringBuilder")
success = sb.Append("<abc><person><name>Joe</name></person><company><name>Chilkat Software</name></company></abc>")

' The GetAfterBetween method gets the substring between two arbitrary marker strings, and doesn't
' start searching until the searchAfter string is passed.

' For example, to get the company name in the string above...
searchAfter = "<company>"
companyName = sb.GetAfterBetween(searchAfter,"<name>","</name>")
outFile.WriteLine("Company Name = " & companyName)

outFile.Close