Replaces the specified substring with a new string.
ReplacedStr := StrReplace(Haystack, Needle , ReplaceText, OutputVarCount, Limit)
This function returns a version of Haystack whose contents have been replaced by the operation. If no replacements are needed, Haystack is returned unaltered.
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.
StringReplace, RegExReplace(), InStr(), StringCaseSense, SubStr(), Trim(), StrLen(), StringLower, StringUpper
Removes all CR+LF's from the clipboard contents.
Clipboard := StrReplace(Clipboard, "`r`n")
Replaces all spaces with pluses.
NewStr := StrReplace(OldStr, A_Space, "+")
Removes all blank lines from the text in a variable.
Loop { MyString := StrReplace(MyString, "`r`n`r`n", "`r`n", Count) if (Count = 0) ; No more replacements needed. break }