ReplaceSTR() is just a convoluted way of SplitJoining a string as has already been explained in numerous posts.
Code:

$string=join(split($string,$search),$replace)

_________________________
There are two types of vessels, submarines and targets.