How to trim a std::string? | Stack Overflow | GitHub | Query Bro
How to trim a std::string? EDIT Since c++17, some parts of the standard library were removed. Fortunately, starting with c++11, we have lambdas which are a superior Using Boost’s string algorithms would be easiest: str is now “hello world!”. There’s also trim_left and trim, which trims both sides. Second Solution : – This works for the null case as well. 🙂