Replace string

From Kolmafia
Revision as of 15:05, 12 March 2010 by imported>StDoodle
Jump to navigation Jump to search
needs(code_samples);

Function Syntax

buffer replace_string(buffer original ,string find ,string replace )

buffer replace_string(string original ,string find ,string replace )

  • original is the starting string or buffer
  • find is the text to find in original
  • replace is the text to substitute for find

Searches through the supplied original text, replacing every instance of find with replace, and returns the result.

Special

Matches are made left-to-right, and once a portion of the supplied original is noted as a match, searching continues from the next character after said match.


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific questions have been raised:

  • Is the special note correct, or is the behavior different?
  • I'm having a hard time clarifying what I mean... see Discussion page