MQL4 Reference String Functions StringReplace
StringReplaceIt replaces all the found substrings of a string by a set sequence of symbols.
Parameters str [in][out] The string in which you are going to replace substrings. find [in] The desired substring to replace. replacement [in] The string that will be inserted instead of the found one. Return Value The function returns the number of replacements in case of success, otherwise -1. To get an error code call the GetLastError() function. Note If the function has run successfully but no replacements have been made (the substring to replace was not found), it returns 0. The error can result from incorrect str or find parameters (empty or non-initialized string, see StringInit() ). Besides, the error occurs if there is not enough memory to complete the replacement. Example:
See also StringSetCharacter(), StringSubstr() |