File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -566,7 +566,7 @@ namespace pcs // i.e. "pythonic c++ strings"
566566 return first + *this + this ->join (others...);
567567 }
568568
569- /* * \brief A single parameter signature. Returns a copy of this parameter. */
569+ /* * \brief Single parameter signature. Returns a copy of this parameter. */
570570 inline const CppStringT join (const CppStringT& s) const noexcept
571571 {
572572 return s;
@@ -579,6 +579,21 @@ namespace pcs // i.e. "pythonic c++ strings"
579579 }
580580
581581
582+ // --- ljust() -----------------------------------------
583+ /* * \brief Returns the string left justified in a string of length width.
584+ *
585+ * Padding is done using the specified fillchar (default is an ASCII space).
586+ * The original string is returned if width is less than or equal to len(s).
587+ */
588+ inline CppStringT ljust (const size_type width, const value_type fillch = value_type(' ' )) const noexcept
589+ {
590+ if (this ->size () >= width)
591+ return *this ;
592+ else
593+ return CppStringT (width - this ->size (), fillch) + *this ;
594+ }
595+
596+
582597 // --- lower () -----------------------------------------
583598 /* * \brief In-place replaces all characters of the string with their lowercase conversion. Returns a reference to string.
584599 *
You can’t perform that action at this time.
0 commit comments