1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MQL5で、StringBuilderを実装する(簡易版)

Posted at

mql5を使って、EA作成に挑戦しています。普段の仕事では、.net を主に使っているので、便利な関数を移植しようと思います。

StringBuilder

文字列をくっつけてくれたり、改行しておいてくれたりです。

コード

class CStringBuilder {
private:
    string _s;
public:
    CStringBuilder(){};
    ~CStringBuilder(){};
    
    //+--------------------------------------------------------------+    
    void Clear(){_s="";}
    void Append(string s){ _s+=s;}
    void AppendLine(string s){ _s+=s+"\n";}
    string ToString(){return(_s);}
};

利用方法

CStringBuilder sb;
sb.Append("123");
sb.Append("abc");

Print(sb.ToString() );

まとめ

StringBuilder以外にも、移植したら、別記事でまとめていきます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?