s = replace(source_text, old_text, new_text);
The replace function looks at source_text and replaces one or more instances of the substring old_text with the value in new_text. All arguments are string expressions and the replacement is case sensitive, meaning that "c" is recognized as different from "C".
The function returns a new string with the replaced text.
string example = "Robert Smith's son's name is Robert, Jr.";
example = replace(example, "Robert", "Bob");
// result: Bob Smith's son's name is Bob, Jr.
function string GetFileUri(string local_filename)
// get the full path in case the filename is relative
local_filename = path.concat(local_filename);
// convert all slashes to forward slashes
local_filename = replace(local_filename, "\", "/");
// encode the filename as a URI
exit "file:///" + encode(URI, local_filename);
string reports_css_uri = GetFileUri("../CSS/Reports.css");
html_file.write("<link rel='stylesheet' type='text/css' href='%s'>", reports_css_uri);