コンテンツへ
投稿記事 by naohiro19 » 7年前
CODE:
#include #include #include using namespace std; int main() { string date = "2015-12-31"; regex re(R"((\d{4})-(\d{2})-(\d{2}))"); string fmt = "$1年$2月$3日"; string result = regex_replace(date, re, fmt); cout << result << endl; }