NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
nnl::utl::string Namespace Reference

Contains various utility functions for working with strings. More...

Functions

template<typename T>
std::string PrependZero (T num, std::size_t digits=2)
 Converts a number to a string padded with zero's.
bool EndsWith (std::string_view str, std::string_view suffix)
 Checks if a string ends with a specific suffix.
bool StartsWith (std::string_view str, std::string_view prefix)
 Checks if a string starts with a specific prefix.
std::string Join (const std::vector< std::string > &strings, std::string delim=",")
 Joins a container of strings into one string using a delimiter.
std::vector< std::string > Split (std::string_view str, std::string delim=",")
 Splits a string by delimiter.
std::string Truncate (std::string_view str, std::size_t n)
 Truncates a string to specified length.
std::string FloatToString (float value, int n=6)
 Converts a float value to a string with fixed precision.
template<typename T>
std::string IntToHex (T i, bool prefix=false, bool prepend=true)
 Converts an integer to a hexadecimal string.
std::string ToLower (std::string_view str)
 Converts a string to lowercase.
bool CompareNat (std::string_view a, std::string_view b)
 Performs natural string comparison for sorting.

Detailed Description

Contains various utility functions for working with strings.