How do you display a list of folders in a directory?

I’m trying to make a list of all the folders in a directory and then create a GUI and display it on there.

Is it something like this?

string[] dir = Directory.GetDirectories(Application.persistentDataPath);

I’m using C#

Yes that’s what you do.