Posted By

neal_grosskopf on 07/14/09


Tagged

ASP aspnet


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

neal_grosskopf
dan74


Emulate ASP.NET's AppendFormat Method In Classic ASP


 / Published in: ASP
 

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

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

  1. function AppendFormat(input,arr)
  2. for i = 0 to ubound(arr)
  3. input = replace(input,"{" & i & "}",arr(i))
  4. next
  5. AppendFormat = input
  6. end function
  7.  
  8. response.Write AppendFormat("Lorem ipsum dolor sit {0} {1} amet, consectetur {1} adipiscing {1} elit.", array("TEST","TEST2"))

Report this snippet  

You need to login to post a comment.