Replaces the specified substring with a new string.
ReplacedStr := StrReplace(Haystack, Needle , ReplaceText, CaseSense, &OutputVarCount, Limit)
Type: String
The string whose content is searched and replaced.
Type: String
The string to search for.
Type: String
If blank or omitted, Needle will be replaced with blank (empty), meaning it will be omitted from the return value. Otherwise, specify the string to replace Needle with.
Type: String or Integer (boolean)
If omitted, it defaults to Off. Otherwise, specify one of the following values:
On or 1 (true): The search is case-sensitive.
Off or 0 (false): The search is not case-sensitive, i.e. the letters A-Z are considered identical to their lowercase counterparts. Unicode case pairs also match, as with StrCompare's Off setting.
Locale: Currently uses the same Unicode case-insensitive search as Off. AutoHotkey applies the current user's locale in this mode; for locale comparisons, see StrCompare.
Type: VarRef
If omitted, the corresponding value will not be stored. Otherwise, specify a reference to the output variable in which to store the number of replacements that occurred (0 if none).
Type: Integer
If omitted, it defaults to -1, which replaces all occurrences of the pattern found in Haystack. Otherwise, specify the maximum number of replacements to allow. The part of Haystack to the right of the last replacement is left unchanged.
Type: String
This function returns the replaced version of the specified string.
The built-in variables A_Space and A_Tab contain a single space and a single tab character, respectively. They are useful when searching for spaces and tabs alone or at the beginning or end of Needle.
RegExReplace, InStr, SubStr, StrLen, StrLower, StrUpper