打印文件
cat testfile.txt
demo_test_file_2022-06-06
我需要这样的输出
demo_test_file_ 2022-06-06
请帮助我在Linux中出现数字时分割行
thanks in advance
您需要将该文件逐行读取到std::string
变量中,然后使用find_first_of查找第一个数字。
然后使用substr