framapiaf.org est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Un service Mastodon fourni par l'association d’éducation populaire Framasoft.

Administré par :

Statistiques du serveur :

1,4K
comptes actifs

#char

1 message1 participant0 message aujourd’hui

There's this recent post pointing out there are a couple of interesting methods in the char class like IsLetter or IsLetterOrNumber. The .NET API is so vast that I'm not surprised people are discovering new methods. One reason for my posts is to get familiar with things that might not be universally known. The char class has a lot of interesting functions, but one has to be careful when using them.

For majority of cases we could use char.IsLetter to check if a character is a letter in a string.

That would be a mistake if, for example, we did it for words written in e.g. Osage. Checking letters with IsChar would yield 0 as a count. It's better to use the Rune class. Rune is a better replacement as it's aware of characters outside the Basic Multilingual Plane.

In example 1️⃣, using char.IsLetter would return 0. If we switch to Rune.IsLetter (as in 2️⃣), we would get the correct value of 4.

Docs 📑: learn.microsoft.com/en-us/dotn

#dotnet #api #char #rune #unicode
---
If you find this useful, consider giving a like & share ♻

s/ : court de ce gratuit de simulation de combat allant de la seconde guerre mondiale à l'époque de la guerre froide.

Développé et publié par en décembre 2016.

Dans cette première partie, on s'intéresse aux forces terrestres, avec l'armée russe au rang II.

À voir :
- sur PeerTube : videos.pair2jeux.tube/videos/w
- sur YouTube : youtu.be/88zOeWD-RDU

#gaming#jeu#tank