Skip to content

A simple header-only, single-file string toolbox library for C++.

License

Notifications You must be signed in to change notification settings

chrberger/stringtoolbox

Repository files navigation

stringtoolbox - a simple header-only, single-file string toolbox library for C++

Build Status Build status License: MIT

stringtoolbox is a small and efficient library written in modern C++ library to provide some features for processing std::strings.

stringtoolbox is available as single-file, header-only library - just drop stringtoolbox.hpp into your project, #include "stringtoolbox.hpp", and compile your project with a modern C++ compiler (C++11 or newer).

Table of Contents

Features

  • Written in highly portable and high quality C++11
  • Available as header-only, single-file distribution - just drop stringtoolbox.hpp into your project, #include "stringtoolbox.hpp", and compile your project with a modern C++ compiler (C++11 or newer)
  • Remove leading whitespace characters: std::string retVal = stringtoolbox::ltrim(" Hello World!");
  • Remove trailing whitespace characters: std::string retVal = stringtoolbox::rtrim("Hello World! ");
  • Remove leading and trailing whitespace characters: std::string retVal = stringtoolbox::trim(" Hello World! ");
  • Replace all occurrences of given character: std::string retVal = stringtoolbox::replaceAll("Hello World.", '.', '!');
  • Split a string using the given delimiter: std::vector<std::string> retVal = stringtoolbox::split("Hello,World", ',');

Dependencies

No dependencies! All you need is a C++11-compliant compiler (we are testing with GCC 4.8.4 and MSVC 19.0.24215.1) as the project ships the following dependencies as part of the source distribution:

Installation

Installation as single-file, header-only library

stringtoolbox is provided as header-only, single-file library as well - just drop stringtoolbox.hpp into your project, #include "stringtoolbox.hpp", and compile your project with a modern C++ compiler (C++11 or newer)

Projects using stringtoolbox

If your project is using stringtoolbox, just let us know :-)

Contributing

We are happy to receive your PRs to accelerate libcluon's development; before contributing, please take a look at the Contribution Documents.

License

  • This project is released under the terms of the MIT License - License: MIT