Return to Snippet

Revision: 15705
at July 14, 2009 08:11 by neal_grosskopf


Initial Code
function AppendFormat(input,arr)
 for i = 0 to ubound(arr)
  input = replace(input,"{" & i & "}",arr(i))
 next
 AppendFormat = input
end function

response.Write AppendFormat("Lorem ipsum dolor sit {0} {1} amet, consectetur {1} adipiscing {1} elit.", array("TEST","TEST2"))

Initial URL
http://www.nealgrosskopf.com/tech/thread.asp?pid=54

Initial Description
Learn how to emulate ASP.NET's AppendFormat method in Classic ASP. AppendFormat is essentially a simple form of concatenation in ASP.NET.

Initial Title
Emulate ASP.NET's AppendFormat Method In Classic ASP

Initial Tags
ASP, aspnet

Initial Language
ASP