I guess the topic says it all. I'm trying to determine how many directories a filepath specifies by counting the slashes in the string.
You use [man]substr_count/man