Modernes C++ programmieren

Okt 23, 2024

lst-0908-godb.cpp

//#(compile) c++; compiler:g132; options:-O3 -std=c++23; libs:-
// https://godbolt.org/z/rErP43G89 
#include <regex>
#include <string>
#include <iostream>
using std::string;
int main() {
    string text = "Titel;Album;Interpret";
    std::regex muster{";"};
    string neu = std::regex_replace(text, muster, string{","});
    std::cout << neu << "\n"; // Ausgabe: Titel,Album,Interpret
}