Skip to content

Commit 14ecbfe

Browse files
committed
#64 - Implement method rfind_n()
Completed.
1 parent 7eb0631 commit 14ecbfe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpp-strings/cppstrings.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class CppStringT : public std::basic_string<CharT>
138138
*/
139139
inline CppStringT center(const size_type width, const value_type fillch = value_type(' ')) const noexcept
140140
{
141-
const size_type l{ this->length() };
141+
const size_type l{ this->size() };
142142
if (l <= width)
143143
return CppStringT(*this);
144144
const size_type half{ (width - l) / 2 };
@@ -150,7 +150,7 @@ class CppStringT : public std::basic_string<CharT>
150150
/** \brief Returns the number of non-overlapping occurrences of substring sub in the range [start, end]. */
151151
inline constexpr size_type count(const CppStringT& sub, const size_type start = 0, const size_type end = 0) const noexcept
152152
{
153-
const size_type length{ this->length() };
153+
const size_type length{ this->size() };
154154
const size_type end_{ (end == 0) ? length : end };
155155

156156
size_type n = 0;
@@ -269,7 +269,7 @@ class CppStringT : public std::basic_string<CharT>
269269
/** \brief Returns true if the string contains only one character and if this character belongs to the ASCII punctuation set. */
270270
inline const bool is_punctuation() const noexcept
271271
{
272-
return this->length() == 1 && is_punctuation((*this)[0]);
272+
return this->size() == 1 && is_punctuation((*this)[0]);
273273
}
274274

275275
/** \brief Returns true if character belongs to the ASCII punctuation set. */
@@ -288,7 +288,7 @@ class CppStringT : public std::basic_string<CharT>
288288
*/
289289
inline const bool is_space() const noexcept
290290
{
291-
if (this->length() == 0)
291+
if (this->size() == 0)
292292
return false;
293293
for (auto& c : *this)
294294
if (!is_space(c))

0 commit comments

Comments
 (0)