Contains methods that perform string manipulation.
Methods package that perform string manipulation.
-
Add the content of the
src
folder to the folder containing your project's source files -
Add the content of the
include
folder to the folder containing your project's header files -
Copy the
Makefile
to your project's root folder (if you already has one, merge the files) -
Run the following commands:
$ make clean
$ make
- 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.
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 | - |
Details about each version are documented in the releases section.
See the documentation on how you can contribute to the project here.
Name | Type | Description |
---|---|---|
dist | Directory |
Released versions |
docs | Directory |
Documentation files |
src | Directory |
Source files |