lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
lintel::StringUtils Class Reference

#include <StringUtils.h>

Public Member Functions

 StringUtils ()=delete
 
 StringUtils (StringUtils &)=delete
 
 StringUtils (StringUtils &&)=delete
 

Static Public Member Functions

static std::vector< std::string > split (const std::string &s, char delimiter)
 
static constexpr bool startsWith (std::string_view s, std::string_view start)
 
static constexpr bool endsWith (std::string_view s, std::string_view end)
 
static std::string replaceAll (const std::string &s, std::string &&replace, std::string &&with)
 

Detailed Description

Class for collecting of extra string utils

Constructor & Destructor Documentation

◆ StringUtils() [1/3]

lintel::StringUtils::StringUtils ( )
delete

◆ StringUtils() [2/3]

lintel::StringUtils::StringUtils ( StringUtils &  )
delete

◆ StringUtils() [3/3]

lintel::StringUtils::StringUtils ( StringUtils &&  )
delete

Member Function Documentation

◆ endsWith()

static constexpr bool lintel::StringUtils::endsWith ( std::string_view  s,
std::string_view  end 
)
inlinestaticconstexpr

Check if a string ends with the given suffix.

Parameters
sthe string to check
endthe suffix to look for
Returns
true if s ends with end

◆ replaceAll()

static std::string lintel::StringUtils::replaceAll ( const std::string &  s,
std::string &&  replace,
std::string &&  with 
)
static

Replace all occurrences of a substring with another string.

Parameters
sthe input string
replacethe substring to replace
withthe replacement string
Returns
the resulting string

◆ split()

static std::vector< std::string > lintel::StringUtils::split ( const std::string &  s,
char  delimiter 
)
static

function splits string with defined delimter into tokens

Parameters
sstring to be split
delimiterfor differentiate between tokens
Returns
tokens in vector

◆ startsWith()

static constexpr bool lintel::StringUtils::startsWith ( std::string_view  s,
std::string_view  start 
)
inlinestaticconstexpr

Check if a string starts with the given prefix.

Parameters
sthe string to check
startthe prefix to look for
Returns
true if s starts with start

The documentation for this class was generated from the following file: