string doc

This commit is contained in:
2022-04-04 16:17:23 +03:00
parent f83d08cf56
commit fb282d405d
5 changed files with 1435 additions and 821 deletions

View File

@@ -35,7 +35,11 @@
//! \details
//! \~english Example:
//! \~russian Пример:
//! \~\snippet pistring.cpp PIStringList::join
//! \~\code
//! PIStringList sl("1", "2");
//! sl << "3";
//! piCout << sl.join(" < "); // 1 < 2 < 3
//! \endcode
PIString PIStringList::join(const PIString & delim) const {
PIString s;
for (uint i = 0; i < size(); ++i) {
@@ -50,7 +54,12 @@ PIString PIStringList::join(const PIString & delim) const {
//! \details
//! \~english Example:
//! \~russian Пример:
//! \~\snippet pistring.cpp PIStringList::removeStrings
//! \~\code
//! PIStringList sl("1", "2");
//! sl << "1" << "2" << "3";
//! piCout << sl; // {"1", "2", "1", "2", "3"}
//! piCout << sl.removeStrings("1"); // {"2", "2", "3"}
//! \endcode
PIStringList & PIStringList::removeStrings(const PIString & value) {
for (uint i = 0; i < size(); ++i) {
if (at(i) == value) {
@@ -65,7 +74,12 @@ PIStringList & PIStringList::removeStrings(const PIString & value) {
//! \details
//! \~english Example:
//! \~russian Пример:
//! \~\snippet pistring.cpp PIStringList::removeDuplicates
//! \~\code
//! PIStringList sl("1", "2");
//! sl << "1" << "2" << "3";
//! piCout << sl; // {"1", "2", "1", "2", "3"}
//! piCout << sl.removeDuplicates(); // {"1", "2", "3"}
//! \endcode
PIStringList& PIStringList::removeDuplicates() {
PIStringList l;
PIString s;
@@ -91,7 +105,11 @@ PIStringList& PIStringList::removeDuplicates() {
//! \details
//! \~english Example:
//! \~russian Пример:
//! \~\snippet pistring.cpp PIStringList::trim
//! \~\code
//! PIStringList sl(" 1 ", "\t2", " 3\n");
//! piCout << sl; // {" 1 ", " 2", " 3\n"}
//! piCout << sl.trim(); // {"1", "2", "3"}
//! \endcode
PIStringList & PIStringList::trim() {
for (uint i = 0; i < size(); ++i)
(*this)[i].trim();