###Function###
StringReplace

###Description###
Replaces substrings in a string.

###Syntax###
StringReplace ( "string", "searchstring/start", "replacestring" [, occurrence = 0 [, casesense = 0]] )


###Parameters###
@@ParamTable@@
string
	The string to evaluate.
searchstring/start
	The substring to search for or the character position to start the replacement.
replacestring
	The replacement string.
occurrence
	[optional] The number of times to replace the searchstring. Use a negative occurrence to replace from the right side.
		0 = all searchstrings will be replaced (default)
casesense
	[optional] Flag to indicate if the operations should be case sensitive.
		$STR_NOCASESENSE (0) = not case sensitive, using the user's locale (default)
		$STR_CASESENSE (1) = case sensitive
		$STR_NOCASESENSEBASIC (2) = not case sensitive, using a basic/faster comparison
	Constants are defined in StringConstants.au3
@@End@@

###ReturnValue###
Returns the new string with the number of replacements performed stored in the @extended macro.


###Remarks###
By default or if the occurrence is positive the search/replace is performed left-to-right.  Thus, <a href="StringReplace.htm">StringReplace</a>("aaa", "aa", "bb") returns "bba"

If the start method is used the occurrence and casesense parameters are ignored. If the replacestring cannot be stored an empty string is returned and @error is set to 1.


###Related###
StringAddCR, StringLeft, StringLen, StringLower, StringMid, StringRight, StringStripWS, StringTrimLeft, StringTrimRight, StringUpper


###Example###
@@IncludeExample@@
