Remove last n character from string

To add comments, please log in or register
KSforex
282
KSforex  

Hi


for example we have different strings:

1- "abcd abcde efg"

2- "abcd 123 efg jkl"

3- "abcd 456 tuv 567"

....

..

.


I want to remove last 4 characters .

There is no useful function here https://docs.mql4.com/strings . and can't use "StringReplace" because the last 4 character  are not fixed. how should I do this?

Thanks for help

String Functions - MQL4 Reference
String Functions - MQL4 Reference
  • docs.mql4.com
String Functions - MQL4 Reference
paul selvan
629
paul selvan  

hi

 string p = "0123456789";
 string q = StringSubstr(p,0,StringLen(p)-4);
KSforex
282
KSforex  
paul selvan:

hi

Very Helpful ! Thanks 

nicholi shen
2392
nicholi shen  
https://www.mql5.com/en/forum/262621#comment_7975173
How can i remove specific letters from a string?
How can i remove specific letters from a string?
  • 2018.07.03
  • www.mql5.com
Hi, please someone can help me to remove letters from words in a string ? thanks for any help...
To add comments, please log in or register