I saw this C# using statement in a code example:
using StringFormat=System.Drawing.StringFormat;
What's that all about?
abbreviation for Celsius: The temperature today reached 25°C.
Summary of Key Points "Very Happy" is the most common definition for C: on Snapchat, WhatsApp, Facebook, Twitter, Instagram, and TikTok. C: Definition: Very Happy.
Wyd is a texting and internet acronym that stands for What (are) you doing? or What (would) you do?
“C” at the end of a tweet indicates that the tweet's content is copied from another source, commonly called copypasta. Sometimes, “c” is also used as a substitute for “see.” It can also be used as an emoji, representing a smiley face.
That's aliasing a typename to a shorter name. The same syntax can also be used for aliasing namespaces. See using directive.
(Updated in response to Richard)
It's an alias, from now on, the user can use StringFormat to refer to System.Drawing.StringFormat. It's useful if you don't want to use the whole namespace (in case of name clash issues for example).
source: using Directive article from MSDN
Perhaps a different, unrelated StringFormat is declared in another namespace like Acme.Stuff. If that were the case, this would cause confusion:
using System.Drawing; // Contains StringFormat type.
using Acme.Stuff; // Contains another StringFormat type.
private void Foo()
{
StringFormat myFormat = new StringFormat(); // which one to use?
}
Aliasing is with using on the StringFormat=System.Drawing.StringFormat clears up some of the confusion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With