<RetVar> = Variable containing the new string with the substituted text.
<Var/String> = The string you want to substitue the text in.
<Var/String> = The text you want to replace.
<Var/String> = The new text to use in the string.
Returns '-1' if the pattern to be subtituted is not found in the string being checked.
Returns the new string with the old pattern substituted for the new one, if the pattern to be replaced is found in the original string.
Example:
$this.string = 'You have successfuly destroyed the attacking fleet.'
$old.text = 'successfuly destroyed'
$new.text = 'had all your assets totaly destroyed by'
$new.text.string = substitute in string $this.string: pattern $old.text with $new.text
The above example would change,
'You have successfuly destroyed the attacking fleet.'
into,
'You have had all your assets totaly destroyed by the attacking fleet.'
Command Location:
- »» General Commands
- »» Strings
<RetVar> = substitute in string <Var/String>: pattern <Var/String> with <Var/String>
- »» Strings