Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,851 questions

51,772 answers

573 users

How to get all the punctuation characters in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        for (char i = char.MinValue; i < char.MaxValue; i++) {
            if (char.IsPunctuation(i)) {
                Console.WriteLine("{0} {1}", i, (int)i);
            }
        }
    }
}



/*
run:

! 33
" 34
# 35
% 37
& 38
' 39
( 40
) 41
* 42
, 44
- 45
. 46
/ 47
: 58
; 59
? 63
@ 64
[ 91
\ 92
] 93
_ 95
{ 123
} 125
¡ 161
« 171
­ 173
· 183
» 187
¿ 191
; 894
· 903
՚ 1370
՛ 1371
՜ 1372
՝ 1373
՞ 1374
՟ 1375
։ 1417
֊ 1418
־ 1470
...

*/

 



answered Sep 13, 2020 by avibootz
...