Read the documentation on the function StringReplace() - https://docs.mql4.com/strings/stringreplace
string v5="- .82523"; string temp2 = v5; int CountReplaced = StringReplace(temp2," ",""); PrintFormat("Count: %d, v5: [%s], temp2: [%s]", CountReplaced, v5, temp2);
Run the above code and see what is printed before you post any comments!
Fernando Carreiro:
Read the documentation on the function StringReplace() - https://docs.mql4.com/strings/stringreplace
Run the above code and see what is printed before you post any comments!
Understood , thank you for the help

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi
I am trying to make the EA look for a certain value in a string and if that value exists in the string then remove it.
I tried doing it using the StringReplace() but i noticed it only returns the number of replacements and didnt actually returned the updated string:
in the above code there is a white space between "-" and ".82523" and i am trying to remove that white space.
so the string is - .82523 and i am trying to get -.82523 , which function can be used for this ?
initially i thought i could do it by using the StringReplace() function , but seems like it only returns the Number of replacements that had happened and not the updated string.
Thanks in Advance