Added uPad function for convenience

This commit is contained in:
matlabbe
2024-06-19 15:58:24 -07:00
parent 4c1822683a
commit 1ab0133f14
3 changed files with 43 additions and 43 deletions
+10
View File
@@ -809,4 +809,14 @@ inline int uCompareVersion(const std::string & version, int major, int minor=-1,
return -1;
}
inline std::string uPad(const std::string & title, int padding = 20)
{
int emptySize = padding - (int)title.size();
if(emptySize>0)
{
return title + std::string(emptySize, ' ');
}
return title;
}
#endif /* USTL_H */