How to separete the letters of a word ?

 

Hi

I have to separate the letters of a  word , for example "USDJPY", then change it to "U,S,D,J,P,Y".  I mean using a Comma or Slash between it's letters.

can you help me please ?

 
If it is related to the symbol/pairs in Metatrader (you want to change) so ask your broker for support.

Because the charts, the price on the charts, the symbols to trade, and the names of the symbols, and the time of the price on the chart - all of them are related to the brokers only.

MetaQuotes is not a broker.
 
saeed Golshenas:

Hi

I have to separate the letters of a  word , for example "USDJPY", then change it to "U,S,D,J,P,Y".  I mean using a Comma or Slash between it's letters.

can you help me please ?

Try this:
  • StringLen - Determines the length of the input string.
  • StringSubstr - Extracts one character at position from the string.

    Documentation on MQL5: String Functions / StringLen
    Documentation on MQL5: String Functions / StringLen
    • www.mql5.com
    Returns the number of symbols in a string. Parameters string_value [in]  String to calculate length. Return Value Number of symbols in a...
     
    saeed Golshenas: I have to separate the letters of a  word ,
    1. No idea why you have that need.
          How To Ask Questions The Smart Way. (2004)
             Be precise and informative about your problem
                The XY Problem

    2. Show us your attempt (using the CODE button) and state the nature of your difficulty.
                No free help (2017)

     
    saeed Golshenas:

    Hi

    I have to separate the letters of a  word , for example "USDJPY", then change it to "U,S,D,J,P,Y".  I mean using a Comma or Slash between it's letters.

    can you help me please ?

    string SeparateEveryChar(string s,string separator=",")
    {
       int len=StringLen(s);
       if (len<2) return s;
       string res=StringSubstr(s,0,1);
       for(int i=1;i<len;i++) {
          res+=separator+StringSubstr(s,i,1);
       }
       return res;
    }