spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * String functions

Replace

String.Replace(string lookForText, string replaceWithText,
               optional bool caseSensitive)
Creates a copy of this string, with all instances of lookForText replaced with the replaceWithText.

caseSensitive is false by default, but you can set it to true so that only case-sensitive matches of the lookForText will be replaced.

NOTE: The new string is returned from this function; it does NOT modify the original string.

Example:

String original = "Hello from the script!";
String changed = original.Replace("hello", "goodbye");
Display("Old: %s, new: %s", original, changed);
will display "Old: Hello from the script!, new: goodbye from the script!".

Compatibility: Supported by AGS 3.1.0 and later versions.

See Also: String.ReplaceCharAt


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.