Skip to content

Instantly share code, notes, and snippets.

@Ilgrim
Forked from Fiona-J-W/gist:9043197
Created September 17, 2020 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ilgrim/b2a51523002d1dff2947c287ed0bafef to your computer and use it in GitHub Desktop.
Save Ilgrim/b2a51523002d1dff2947c287ed0bafef to your computer and use it in GitHub Desktop.
#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