common: added function to split a string to a vector by using a delimiter

This commit is contained in:
Gwenhael Goavec-Merou
2025-03-18 22:39:44 +01:00
parent 4a5a912b9d
commit 719697eabe
2 changed files with 29 additions and 0 deletions
+9
View File
@@ -17,4 +17,13 @@
const std::string get_shell_env_var(const char* key,
const char *def_val="") noexcept;
/*!
* \brief convert a string, separate by delim to a vector
* \param[in] in: string to split
* \param[in] delim: split caracter
* \return vector a substring
*/
const std::vector<std::string> splitString(const std::string& in,
const char delim) noexcept;
#endif // SRC_COMMON_HPP_