using System; using System.Collections.Generic; using System.Text; namespace DemoOOP2 { class BasicStringBuilder { // Attributes (essentially global variables // within the class) private string _text; // Constructors // It is named after the class // It has no return type public BasicStringBuilder() // Default constructor { _text = ""; // Default values } public BasicStringBuilder(string initialText) { _text = initialText; } // Properties public string Text { get { return _text; } } // Methods (functions) public void AppendText(string text) { _text = _text + text; } public void AppendInteger(int number) { string text = number.ToString(); AppendText(text); //_text = _text + number.ToString(); //_text += number.ToString(); } public void AppendDouble(double number) { _text = _text + number.ToString(); } public void Reset() { _text = ""; } // Getter method public string GetText() { return _text; } } }