Skip to content

wniemiec-util-cpp/string-utils

Repository files navigation

String Utils

Contains methods that perform string manipulation.

Coverage status Cpp compatibility Release License


❇ Introduction

Methods package that perform string manipulation.

❓ How to use

  1. Add the content of the src folder to the folder containing your project's source files

  2. Add the content of the include folder to the folder containing your project's header files

  3. Copy the Makefile to your project's root folder (if you already has one, merge the files)

  4. Run the following commands:

$ make clean
$ make
  1. 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