How do you get the path of an enclosing folder?

I thought I figured this out before, but I can’t at the moment!

What I want is what

AssetDatabase.GetAssetPath

gets you, except without the name and extension of the file at the end. I want to put stuff in that folder, you see.

The MSDN is your friend :wink:

string assetPath = AssetDatabase.GetAssetPath(...);
string path = assetPath.Substring(0, assetPath.LastIndexOf('/'));

The code may be 1 index off and may have the slash the wrong way around (I can’t test :P), but that’s the general idea anyway.