var$ = ReplaceStr(s$, search$, replace$[, cs, startpos, encoding])
search$
in s$
and replaces all occurrences of search$
with
replace$
. The optional argument cs
turns case sensitivity
on (True
) or off (False
). This defaults to the global case sensitive default
mode set using IgnoreCase(). See IgnoreCase for details.
Starting with Hollywood 4.5, you can also specify a starting position
for the search in the optional argument startpos
. This position needs
to be specified in characters, not in bytes. Specifying 0 as the starting
position means search and replace from the beginning of the string. This is
also the default.
The optional encoding
parameter can be used to set the character encoding
to use. This defaults to the default string encoding set using SetDefaultEncoding().
See Character encodings for details.
search$
search$
True
for case sensitivity, False
for no case sensitivity; the default
is True
or whatever default has been set using the IgnoreCase() commandtest$ = "Hello World!" test$ = ReplaceStr(test$, "World", "People") Print(test$)This will print "Hello People!" to the screen.