I'm trying to strip only path from a c string
char *path = "~/folder/sometext.txt"
so I would get only "~/folder/"
Anyone got a hint on how to achieve this? I was thinking of something similar to std::string find_last_of
so I could just indicate the last "/" or "\" in the string and then anything that comes after that will
be removed from the string. But I'm writing this in c only so c++ solutions are not an option.