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 str
18 {
27 [[nodiscard]]
28 std::vector<std::string> split(std::string_view input, std::string_view delim) noexcept;
29
39 [[nodiscard]]
40 std::string replace_first(std::string input, std::string_view to_replace, std::string_view replace_with) noexcept;
41
53 [[nodiscard]]
54 std::string replace_all(std::string input, std::string_view to_replace, std::string_view replace_with) noexcept;
55
64 [[nodiscard]]
65 bool begins_with(const std::string& input, const std::string& find) noexcept;
66
74 [[nodiscard]]
75 std::string rtrim(std::string input) noexcept;
76
84 [[nodiscard]]
85 std::string ltrim(std::string input) noexcept;
86
94 [[nodiscard]]
95 std::string trim(std::string input) noexcept;
96
104 [[nodiscard]]
105 std::string make_single_spaced(std::string input) noexcept;
106 } // namespace str
107} // namespace galaxy
108
109#endif
std::string rtrim(std::string input) noexcept
Trim string from start.
std::string replace_all(std::string input, std::string_view to_replace, std::string_view replace_with) noexcept
Replaces all occurrences of a string.
std::vector< std::string > split(std::string_view input, std::string_view delim) noexcept
Split a string based on a delimiter.
std::string ltrim(std::string input) noexcept
Trim string from end.
bool begins_with(const std::string &input, const std::string &find) noexcept
Check if string begins with another string.
std::string trim(std::string input) noexcept
Trim both ends of string.
std::string make_single_spaced(std::string input) noexcept
Make a string single spaced.
std::string replace_first(std::string input, std::string_view to_replace, std::string_view replace_with) noexcept
Replace first occurrence of a string.
Timer.hpp galaxy.
Definition Timer.cpp:18