galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
StringUtils.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_UTILS_STRINGUTILS_HPP_
9#define GALAXY_UTILS_STRINGUTILS_HPP_
10
11#include <string_view>
12#include <string>
13#include <vector>
14
15namespace galaxy
16{
17 namespace strutils
18 {
27 [[nodiscard]]
28 std::vector<std::string> split(std::string_view input, std::string_view delim) noexcept;
29
39 void replace_first(std::string& input, std::string_view to_replace, std::string_view replace_with) noexcept;
40
50 void replace_all(std::string& input, std::string_view to_replace, std::string_view replace_with) noexcept;
51
60 [[nodiscard]]
61 bool begins_with(const std::string& input, const std::string& find) noexcept;
62
68 void rtrim(std::string& input) noexcept;
69
75 void ltrim(std::string& input) noexcept;
76
82 void trim(std::string& input) noexcept;
83
89 void make_single_spaced(std::string& input) noexcept;
90 } // namespace strutils
91} // namespace galaxy
92
93#endif
void make_single_spaced(std::string &input) noexcept
Make a string single spaced.
void trim(std::string &input) noexcept
Trim both ends of string.
void rtrim(std::string &input) noexcept
Trim string from start.
bool begins_with(const std::string &input, const std::string &find) noexcept
Check if string begins with another string.
std::vector< std::string > split(std::string_view input, std::string_view delim) noexcept
Split a string based on a delimiter.
void replace_all(std::string &input, std::string_view to_replace, std::string_view replace_with) noexcept
Replaces all occurrences of a string.
void replace_first(std::string &input, std::string_view to_replace, std::string_view replace_with) noexcept
Replace first occurrence of a string.
void ltrim(std::string &input) noexcept
Trim string from end.
Timer.hpp galaxy.
Definition Async.hpp:17