Shows how to use xtd::text::basic_string_builder::append method.
#include <xtd/text/string_builder>
#include <xtd/console>
#include <xtd/istringable>
private:
string dog_breed;
string dog_name;
public:
dog(const string& name, const string& breed) : dog_breed(breed), dog_name(name) {}
const string& breed() const noexcept {return dog_breed;}
const string& name() const noexcept {return dog_name;}
string to_string() const noexcept override {return dog_name;}
};
auto main() -> int {
auto dog1 = dog {"Mocka", "American Shepherd"};
console::write_line(sb);
}
Provides a way to represent the current object as a string.
Definition istringable.hpp:23
Represents a mutable string of characters. This class cannot be inherited.
Definition basic_string_builder.hpp:35
basic_string_builder & append(const xtd::basic_string< char_t > &value)
Appends a copy of the specified string to this instance.
Definition basic_string_builder.hpp:442
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10