Suppose I have the following string in ASP:
<%
Dim strText
strText="Today is Friday and tomorrow is Friday and tomorrow is a holiday."
%>
I want replace the 'second' Friday in the above string with Saturday. If I use the Replace function like this:
<%
strText=Replace(strText,"Friday","Saturday"
%>
both the Friday(s) in the above string will be replaced by Saturday. How do I ensure that only the 'second' Friday gets replaced with Saturday so that the output will be "Today is Friday and tomorrow is Saturday and tomorrow is a holiday"? Please note that, in reality, the string is generated dynamically & is not a static one as I have shown above.
Thanks,
Arpan
<%
Dim strText
strText="Today is Friday and tomorrow is Friday and tomorrow is a holiday."
%>
I want replace the 'second' Friday in the above string with Saturday. If I use the Replace function like this:
<%
strText=Replace(strText,"Friday","Saturday"
%>
both the Friday(s) in the above string will be replaced by Saturday. How do I ensure that only the 'second' Friday gets replaced with Saturday so that the output will be "Today is Friday and tomorrow is Saturday and tomorrow is a holiday"? Please note that, in reality, the string is generated dynamically & is not a static one as I have shown above.
Thanks,
Arpan