//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;
using (var reader = new StringReader(manyLines))
{
string? item;
do {
item = reader.ReadLine();
Console.WriteLine(item);
} while(item != null);
}
The "using" statement allows you to specify multiple resources in a single statement.