GitHub - wniemiec-util-cpp/string-utils: Contains methods that perform string manipulation.
Contains methods that perform string manipulation.
❇ Introduction
Methods package that perform string manipulation.
❓ How to use
-
Add the content of the
srcfolder to the folder containing your project's source files -
Add the content of the
includefolder to the folder containing your project's header files -
Copy the
Makefileto your project's root folder (if you already has one, merge the files) -
Run the following commands:
- Use it
[...]
#include "wniemiec/data/cpp/StringUtils.hpp";
[...]
std::string text = "hello world";
std::vector<std::string> words = StringUtils::split(text, " "); // Returns ["hello", "world"]
std::cout << StringUtils::to_upper("hello world") << std::endl; // Returns "HELLO WORLD"
[...]
Note: You can use cmake if you wish. To do this, use the CMakeLists.txt file.
📖 Documentation
| Property | Type | Description | Default |
|---|---|---|---|
| split | str: std::string, delimiter: std::string |
Returns a list of the words in the string, separated by the delimiter string | - |
| to_upper | str: std::string |
Returns a copy of the string in UPPER CASE | - |
| replace_all | str: std::string, old_value: std::string, new_value: std::string |
Searches a string for a value and generates a new string with the value(s) replaced | - |
🚩 Changelog
Details about each version are documented in the releases section.
🤝 Contribute!
See the documentation on how you can contribute to the project here.
📁 Files
/
| Name | Type | Description |
|---|---|---|
| dist | Directory |
Released versions |
| docs | Directory |
Documentation files |
| src | Directory |
Source files |
