title: Substring C from string like folder1/file1.txt
body: <p>i have strings like "folder1/file1.txt" or "foldername1/hello.txt" and i need to take the substring that identify the folder name with the slash (/) included <br>(example: from "folder1/file1.txt" i need "folder1/"). <br>The folders name are not all with the same length.
  How can i do this in C?? thanks</p>