Tag Archives: GetInvalidPathChars

List characters that are invalid in file and path names in C#

This example uses the following code to display characters that are invalid in file and path names. private void Form1_Load(object sender, EventArgs e) { string txt = “”; foreach (char ch in Path.GetInvalidFileNameChars()) { if (Char.IsWhiteSpace(ch) || Char.IsControl(ch)) txt += … Continue reading

Posted in files, strings | Tagged , , , , , , , , , , , | Leave a comment