Correct syntax for replacing string value from array values

In PHP there was always a way to have an array of items, but then replace something in a string based on that array.

for example:

<?php
$newarray = array("one","two","three");

$foo = "She had two coin.";

$foo = str_replace($newarray,"xxx",$foo);

echo $foo;
?>

Basically is one, two, or three was found in the string it would be replaced with xxx.

result = ReplaceAll(result,replacements,"")

I was trying to do something similar in xojo, but errors out.

Been searching for the answer, but I must be searching wrong, because I am sure this has come up before.

there isn’t such a thing
don’t think it should be hard to write though

 dim newarray as string = array("one","two","three")

  dim foo as string = "She had two coin."
  
   for each s as string in newarray
       foo = replaceall(foo , s, "xxx" )
   next

or something like that

Ahh ok… thanks Norman. Didn’t want to recreate the wheel if it was already there. Will make a method to handle that. Much appreciated.