My currently problem isbthe following. I have a std::vector of full path names to files. Now i want to cut of the part, which every path has comon in the vector. Like if I have these 3 strings in the vector:
/home/user/foo.txt
/home/user/bar.txt
/home/baz.txt
I would like to cut off /home/ from every string in the vector. Is there any method, to achieve this? I currently only have an idea which solves this problem in O(nm) with n strings an m is the longest string length, by just going throught every string with every other string char by char. Is there a faster or more elegant way solving this?
Aucun commentaire:
Enregistrer un commentaire