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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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"}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply