Blockland Forums > Modification Help

strReplace - Replacing multiple characters at once? (New question)

Pages: << < (2/2)

Electrk:


--- Quote from: Treynolds416 on March 21, 2012, 10:30:35 PM ---I'm sure there's a more efficient way, but you could just stack them up:

--- Code: ---striReplace(striReplace(striReplace("thisxisyaztest","x"," "),"y"," "),"z"," ");
--- End code ---

--- End quote ---

I was thinking something like that, but with variables.

Greek2me:


--- Quote from: Treynolds416 on March 21, 2012, 10:30:35 PM ---I'm sure there's a more efficient way, but you could just stack them up:

--- Code: ---striReplace(striReplace(striReplace("thisxisyaztest","x"," "),"y"," "),"z"," ");
--- End code ---

--- End quote ---
It's easier to just do something like this:


--- Code: ---%blah = strReplace(%blah,"foo","bar");
%blah = strReplace(%blah,"thing1","thing2");
%blah = strReplace(%blah,"run","walk");

echo(%blah);
--- End code ---


Pages: << < (2/2)

Go to full version