How to find maximum number in string array
i have a string array
I want to find string which has maximum index e.g. in this case w_50
How can i do it
Hello,
You can find the largest or lowest value by sorting the contents of the array.
https://docs.mql4.com/array/arraysort
Since the contents of your array are strings, the numbers must be in the following format:
w_01 w_02 w_03 ... w_50
- docs.mql4.com
There are no numbers in a string. ("_10" comes before "_9", etc.)
Isolate the number part, convert it to a number, and store them in a numeric array.
Now you can search that and get the index for both.
Sort orders based on OrderOpenTime MQL4 programming forum (2020)
i have a string array
I want to find string which has maximum index e.g. in this case w_50
How can i do it