string-view-lite
string_view lite - A C++17-like string_view for C++98, C++11 and later in a single-file header-only library (by martinmoene)
pystring
C++ functions matching the interface and behavior of python string methods with std::string (by imageworks)
string-view-lite | pystring | |
---|---|---|
2 | 7 | |
401 | 839 | |
- | 0.4% | |
4.1 | 0.0 | |
4 months ago | 10 months ago | |
C++ | C++ | |
Boost Software License 1.0 | BSD 3-clause "New" or "Revised" License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
string-view-lite
Posts with mentions or reviews of string-view-lite.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-03-13.
-
Is there a std::string::split or something similar?
There are plenty of polyfill libraries that exist for std features like this. I strongly recommend using an existing one that attempts to match the standard closely. For example this one.
-
Use const char* or std::string for string literals?
I see that there is this https://github.com/martinmoene/string-view-lite. Might use it in our project going forward.
pystring
Posts with mentions or reviews of pystring.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-12-07.
-
Why are strings and IO so complicated?
If you are used to python strings give pystring from Sony Imageworks a go. https://github.com/imageworks/pystring
-
For processing strings, streams in C++ can be slow
If performance matters, write your own specialized string processing code which works on "raw" data in memory buffers. If convenience matters look at https://github.com/fmtlib/fmt (or std::format which AFAIK is less feature rich) and https://github.com/imageworks/pystring.
-
Is this a valid use for goto?
Personally I use pystring for my projects as I use both C++ and python so the api is familiar.
-
Is there a std::string::split or something similar?
I've been using this for a number of years https://github.com/imageworks/pystring Works really well especially if you are used to python strings.
-
How can remove the space at the beginning and end of the tokens?
I use this https://github.com/imageworks/pystring for most of my string processing (as I write a lot of both C++ and Python), you can use the lstrip / rstrip and strip methods, you just need to drop in the .cpp and .h files to your projects. It makes life so much easier.
-
Help With File Reading
There are various libraries out there that make this much easier such as boost. Personally I use pystirng https://github.com/imageworks/pystring as I use loads of python too.
What are some alternatives?
When comparing string-view-lite and pystring you can also consider the following projects:
ring-span-lite - ring-span lite - A C++yy-like ring_span type for C++98, C++11 and later in a single-file header-only library
scnlib - scanf for modern C++
semver - Semantic Versioning for modern C++
aoc2023 - C++23 aoc 2023
span-lite - span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library
lexy - C++ parsing DSL
doctest - The fastest feature-rich C++11/14/17/20/23 single-header testing framework
FilesAndParsing
Nameof C++ - Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum