exact string matching and replace

Hello could anyone please help me find any combination of date i-e "yyyymmdd" within a '/' separated string e-g
string = "str1/str2/yyyymmdd/stryymm/str3/str4/str5_yymmdd.b/yyyymm_000.a"
and replace it with an actual date e-g
string date = "20110520"
and then
1
2
3
4
stryymm would become str1105
yyyymmdd = 20110520
str5_yymmdd.b = str5_110520.b
yyyymm_000.a = 201105_000.a


Thanks
use string::find and string::replace until find returns npos. Treat yyyy, yy, mm and dd separately.
closed account (zb0S216C)
Looking into string will reveal some member functions that will aid you.

References:
string: http://www.cplusplus.com/reference/string/string/
Thanks hamsterman and Framework :)
Topic archived. No new replies allowed.