October 22, 2020
Just a little thing, that I learned today. Here is the usual example: someone gave you example json for some API, that you need to implement and first step would be ā created to classes for this json. There is a nice feature in Visual Studio: copy json in clipboard, then you can Edit -> Paste Special-> Paste JSON as classes.
One problem for me was that all fields were lowercase. Fixing them manually was too boring, so I wrote regex to replace first letter to uppercase:
(\bint|\bbool|\bstring|\bfloat\bDateTime) ([a-z])
<- replace this
$1 \u$2
<- to this
No sure, that it will be useful for someone, Iām just proud of myself each time when I can use regex š¤