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
Well to me it's still funny.
I join a string by:
but I can't split this string using "\t" with which I glue the items together?
I understand what you are saying. You would like string split to have been implemented as StringSplit(string,string,string &[]) rather than a single char for splitting. There may be some merit in that point of view. (more versatile and yet 'simpler' for non-coders), But MQL have not implemented it that way.
If you really want to make you own StringSplit(string,string,string &[]) that makes you happy, you could probably combine StringReplace and StringSplit but it will need to be careful!
or you can build your own function
https://www.mql5.com/en/forum/116685
or you can build your own function
https://www.mql5.com/en/forum/116685
Now we have StringReplace and StringSplit it would be much simpler, and faster to use
I wrote, "or you can build your own function" It's up to him
personally i prefer not to change the source string, and leave it as is (by using StringReplace you are changing the source), just to use a copy (string& Out[])
but again, each one with is personal preference
qjol I wrote, "or you can build your own function"
I didnt quite get the 'or' because I was also suggesting the same thing -
It would have made more sense to me if your post read 'or you can do it like this'.
qjol: personally i prefer not to change the source string, and leave it as is
It would not change the source because 'in' is is pass by value in
For clarity you could simply assign 'in' to another string 'inCopy'.
I'd rather a two line function calling built- in functions than the alternative implementation which will be slower and potentially makes many calls to ArrayResize (although there are ways around that, esp with the new ArrayResize), but like you say, personal preference :)
Also I've ommited the check to ensure that USHORT is not already in the original string. So maybe it will end up about 6 lines
https://www.mql5.com/en/forum/116685
Also the last parameter in StringSubstr is changed in MQL4++ so the linked function will need modifying. But that's quite simple once one is aware of it.
I think . . .
"\t" is a string
'\t' is a character ASCII 9
. . . I could be wrong though.