MQL4 Reference
String functions
StringSubstr
| string StringSubstr( |
string text, int start, int length=0) |
Extracts a substring from text string starting from the given position.
The function returns a copy of the extracted substring if possible, otherwise, it returns an empty string.
Parameters:
| text |
- |
String from which the substring will be extracted. |
| start |
- |
Substring starting index. Can be from 0 to StringLen(text)-1. |
| length |
- |
Length of the substring extracted. If the parameter value exceeds or equals to 0 or the parameter is not specified, the substring will be extracted starting from the given position and up to the end of the string. |
Sample:
string text="The quick brown dog jumps over the lazy fox";
string substr=StringSubstr(text, 4, 5);
// subtracted string is the "quick" word
|
|
|