Replace() returns a string in which matching substrings have been replaced. Optional arguments control the starting position, number of replacements and comparison mode.
Replace(string_var, string_find, string_replace, start, count, comparetype)
The defaults begin at position 1, replace all matches, and use the default comparison rules. Prefer named constants such as vbBinaryCompare and vbTextCompare when specifying comparison behavior.
Dim string_var, string_find, string_replace
string_var="Welcome to ASP section for ASP tutorials"
string_find="ASP"
string_replace="PHP"
Response.Write Replace(string_var, string_find, string_replace)
Welcome to PHP section for PHP tutorials
string_find="asp"
Welcome to ASP section for ASP tutorials
Response.Write Replace(string_var, string_find, string_replace, 1, 1, vbTextCompare)
Welcome to PHP section for ASP tutorials
The equivalent argument values are:
start=1
count=1
comparetype=vbTextCompare
The original PHP cross-reference is retained: PHP str_replace().
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.