How to get the punctuation characters from Unicode (ASCII) in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 0; i < 128; i++)
            {
                if (char.IsPunctuation((char)i))
                {
                    Console.WriteLine((char)i);
                }
            }
        }
    }
}

/*
run:

!
"
#
%
&
'
(
)
*
,
-
.
/
:
;
?
@
[
\
]
_
{
}

*/

 



answered Jan 20, 2017 by avibootz

Related questions

1 answer 141 views
1 answer 134 views
1 answer 148 views
1 answer 148 views
3 answers 262 views
...