using in c#

C#
//doing with using function
using (var font1 = new Font("Arial", 10.0f)) 
{
    byte charset = font1.GdiCharSet;
}

//or
using var font1 = new Font("Arial", 10.0f);
byte charset = font1.GdiCharSet;
Source

Also in C#: