(Classic ASP) StringBuilder GetAfterBetween
Demonstrates the GetAfterBetween method.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringBuilder")
set sb = Server.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>")
Response.Write "<pre>" & Server.HTMLEncode( "Company Name = " & companyName) & "</pre>"
%>
</body>
</html>
|