Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <string>
#include <iostream>
int main() {
using std::string;
std::string umlauts_small = u8"äöü";
std::string umlauts_capital = u8"ÄÖÜ";
auto foo = umlauts_small + "|" + umlauts_capital;
// ...
auto middle = std::find(foo.begin(), foo.end(), '|');
std::string part1{foo.begin(), middle}; // "aou"
std::string part2{middle+1, foo.end()}; // „ÄÖÜ“
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.