Page 1 of 1

c++: Turn string separated by comma into a vector of strings without using loops 1. Write a function that takes a string

Posted: Wed Mar 30, 2022 9:19 am
by answerhappygod
c++: Turn string separated by comma into a vector of strings
without using loops
1. Write a function that takes a string with values separated by
commas and return a vector of strings of those values
Do not use for loops, while loops, or
for_each
_________________________________
String: "5 cats,7 dogs,all"
should return vector
{"5 cats","7 dogs","all"}
_____________________________
String: "5 apples,,2 bananas,none,,1 fish"
should return vector
{"5 apples","","2 bananas","none","","1 fish"}