string formatting help

 

Hi 

Currently I use this style of formatting 

string       Massage   = "";
string command = "BUY";
string symbol  = "XAUUSD";
double    BuyPrice = 1842;
double    SLPrice  = 1830;
double    TPPrice  = 1850;

Massage = "INSTANT " + command + " " + symbol + " " + "ENTRY : " + DoubleToStr(BuyPrice) + " " + "SL : "+ DoubleToStr(SLPrice) + " " + "TP : " + DoubleToStr(TPPrice);
 

and Output is 


Now I need This type of Output

so I change string formatting like this 

Massage = StringFormat("Instant %s \r\n %s \r\n ENTRY : %g:\r\n SL : %g:\r\n TP : %g",command,symbol,BuyPrice,SLPrice,TPPrice);

But again result is same 

Can any one help to format like this 

 

 
TBS:vNow I need This type of Output
  1. Output to what? All you posted was strings; that is not output.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

  2. Only Comment supports “\n”

 
William Roeder #:
  1. Output to what? All you posted was strings; that is not output.
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem

  2. Only Comment supports “\n”

Output like seen in image

 

not like this 

 

 

What do you do with

Massage = ...

It is not a comment and it is not printed in the Expert log. So what do you do with Message ? There is your problem!

 
If I remember, telegram uses url encoding/base64 so you would need to encode the new line character accordingly.


 
As far as I am aware, printf also supports new line character, as well as StringFormat does.
 
Dominik Christian Egert #:
If I remember, telegram uses url encoding/base64 so you would need to encode the new line character accordingly.


Thanks 

Reason: