Tokenize a string: Difference between revisions
Content added Content deleted
m (→{{header|C++}}) |
m (→{{header|C++}}) |
||
Line 1,376: | Line 1,376: | ||
s = s // Assign the final string back to the string variable |
s = s // Assign the final string back to the string variable |
||
| std::views::split(',') // Produce a range of the comma separated words |
| std::views::split(',') // Produce a range of the comma separated words |
||
| std::views::join_with('.') // Concatenate the words into a single range of characters |
| std::views::join_with('.') // Concatenate the words into a single range of characters |
||
| std::ranges::to<std::string>(); // Convert the range of characters into a regular string |
| std::ranges::to<std::string>(); // Convert the range of characters into a regular string |
||
std::cout << s; |
std::cout << s; |