Saving an array/string to PC using .NET

I’ve used

richTextBox.SaveFile() before, but I’m curious as to how I can go beyond that to create non .txt files, and create my own custom file types.

I’d imagine if I was to create my own custom file-type, I’d want to have a function that uses each part of the array as a string that manages rendering.

So anyway, is there a way to use .NET to store a file that contains a single array of string?