Manual:DIL Manual/replace()

From DikuMUD Wiki
Jump to navigation Jump to search


Function:  string replace( t :string, n : string, o : string);
  t
         the target string you want to replace
  n
         what you want to replace the target with
  o
         the original string
  return
         the string with the old string replaced by the new string
This function replaces all occurences of a string in another string with a
new string.
Example:
"Jafar %t% %l%" := replace(%n%,pc.name,"%n% %t% %l%");
"Jafar the human %l%" := replace(%t%,pc.title,"Jafar %t% %l%");
"Jafar the human 1" := replace(%l%,itoa(pc.vlevel),"Jafar the human %l%");