Classic ASP
Classic ASP
StringBuilder ReplaceWord
Demonstrates the ReplaceWord method.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set sb = Server.CreateObject("Chilkat.StringBuilder")
success = sb.Append("forest, lumber, lumberjack, jack, timberland")
' The ReplaceWord method replaces word occurances.
' For example:
numReplacements = sb.ReplaceWord("lumber","timber")
numReplacements = sb.ReplaceWord("jack","joe")
' The string content is now:
' forest, timber, lumberjack, joe, timberland
Response.Write "<pre>" & Server.HTMLEncode( sb.GetAsString()) & "</pre>"
%>
</body>
</html>