How to get a list of invalid filename characters in C#

1 Answer

0 votes
using System;
using System.IO;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] array = Path.GetInvalidFileNameChars();

            foreach (char ch in array) {
                Console.WriteLine(ch);
            }
        }
    }
}


/*
run:
  
"
<
>
|
☺
☻
♥
♦
♣
♠

♂
♀

♫
☼
►
◄
↕
‼
¶
§
▬
↨
↑
↓
→
←
∟
↔
▲
▼
:
*
?
\
/

*/

 



answered Aug 17, 2018 by avibootz

Related questions

...