replacing # in text

 

Hello,


Just a symbol question as i'm a beginner.  I use the variable in a printf statement like this  + "text " + Symbol() + " text"  

What i see is   "text #AMZN text"


However i want to replace the # so its blank so that when I type in ...  + "text " +SymbolModified + " text"

What you see is "text AMZN text"


can you tell me the line of code I need to remove the "#" ?   Thank you!

 
StringSubstr(_Symbol,1);
 
Pimpinela:

thanks so much for that response...  if i read up on the StringSubstr correct, the 1 means its going to start on the 1st character ... does that mean 0 is before it?


So it would take #AMZN   # = 0, A = 1, M=2  etc, so it starts on A and would ignore the #?

 
  1. Be careful of your terms. That is not a printf (or PrintFormat or even StringFormat.) That is just a string (from three.) The equivalent would be
    StringFormat("text %s text", Symbol() )

  2. Perhaps you should read the manual.
    1. To remove all # from any position

      string SymbolModified=Symbol(); StringReplace(SymbolModified, "#", "");
      
                String Functions / StringReplace - Reference on algorithmic/automated trading language for MetaTrader 5

    2. To remove the # from the first position
      SymbolModified = StringSubstr(_Symbol, 1);
               String Functions / StringSubstr - Reference on algorithmic/automated trading language for MetaTrader 5
 
whroeder1:
  1. Be careful of your terms. That is not a printf (or PrintFormat or even StringFormat.) That is just a string (from three.) The equivalent would be
  2. Perhaps you should read the manual.
    1. To remove all # from any position

                String Functions / StringReplace - Reference on algorithmic/automated trading language for MetaTrader 5

    2. To remove the # from the first position         String Functions / StringSubstr - Reference on algorithmic/automated trading language for MetaTrader 5
Thanks, this worked.  I did read through the manual as specified, this was just an interpretation of the text.  Thanks again.
Reason: