Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good C++ string manipulation library

Tags:

c++

string

People also ask

Which library is used to manipulate strings?

C Standard Library Another C-style library is <cstdlib>. The string tools in this library are mainly used to manipulate strings and change them into other data types. Below is a sample of some of the functions. You can use all of these tools in C++ but remember that your strings must be in the C format.

What are the most common C standard library functions to manipulate strings?

In this lesson, we studied different functions that can be used to manipulate strings in C programming languages. The most commonly used functions are strlen(), strcmp() and strcpy().

Does C have string library?

SDS is a string library for C designed to augment the limited libc string handling functionalities by adding heap allocated strings that are: Simpler to use.


The C++ String Toolkit (StrTk) Library is a free library that consists of robust, optimized and portable generic string processing algorithms and procedures for the C++ language. The library is designed to be easy to use and integrate within existing code.

The library has the following capabilities:

  • Generic string tokenizer and token iterators
  • Split routines
  • User specified delimiter and splitter policies (simple and regex based etc.)
  • Conversions between data and hex and base-64
  • In-place removal and replace routines
  • Wild-card matching and globing
  • Fast 2D token grid processing
  • Extensible string processing templates

and plenty more...

Compatible C++ Compilers:

  • GCC 4.0+
  • Intel C++ Compiler 9.0+
  • Microsoft Visual C++ 8.0+
  • Comeau C/C++ 4.1+

Source:

  • Download: http://www.partow.net/programming/strtk/index.html
  • SVN: http://code.google.com/p/strtk/

The C++ String Algorithms Library from Boost has pretty much all of the features you need.


I'm not sure I agree. Strings really shouldn't be thread-safe due to the overhead, except for reference-counting, if applicable. Most of the other functionality you want would turn strings into a garbage barge. Likewise, removing dependencies would remove their ability to work well with streams.

The one thing I'd suggest is that we could benefit from an immutable string class, particularly one that has no memory ownership or termination. I've written those before and they can be very helpful.


Bstring - Although I never tried it myself, the feature set and speed presented at their site. Under your choice of GPL or BSD license is also a good degree of freedom.

Also, the name suggests it's better so how can they lie? :)