I have a string of vehicle number, for example kz083y68 and i want to convert it into kz 083 y 68 with spaces. String also could be 3486nv09, etc, so there is no fixed position to split. All i need is to split subsequences of numbers and letters by spaces.
Obviously this can be done manually, but I'm wondering if there is a function in the range-v3 library for this. In general, maybe there is a function that takes some predicate (isdigit, iseven, isdog) and splits given range to corresponding subrange?
Using
views::chunk_byto get a set of sub-views:DEMO.
You can use
views::join_withto get a single view with a selected delimiter:DEMO.