one of the documented procedures in this installation of the ACS
ad_string_replace_once   string   pattern   replacement
What it does:
Replace the first occurrence of PATTERN with REPLACEMENT; return unaltered STRING if PATTERN not found
Defined in: /web/philip/tcl/ad-redirect.tcl

Source code:

    set start [string first $pattern $string]
    if { $start == -1 } {
	return $string 
    } else {
	set string_front [string range $string 0 [expr $start - 1]]
	set string_end [string range $string [expr $start + [string length $pattern]] end]
	append result $string_front $replacement $string_end
	return $result