M
mr h q
Hi all,
i want to replace $ to \$ so linux can work with paths and filenames
that contain $.
I wrote the following code
for(string::size_type i = s.find(exist, 0); i != string::npos; i =
s.find(foo, i))
{
s.replace(i, foo.size(), bar);
}
It's logical that this creates a loop that never ends, because i don't
replace the $, so my question is how to replace $ with \$ and then
jump to the next, instead of replacing \$ again..
tia...
i want to replace $ to \$ so linux can work with paths and filenames
that contain $.
I wrote the following code
for(string::size_type i = s.find(exist, 0); i != string::npos; i =
s.find(foo, i))
{
s.replace(i, foo.size(), bar);
}
It's logical that this creates a loop that never ends, because i don't
replace the $, so my question is how to replace $ with \$ and then
jump to the next, instead of replacing \$ again..
tia...