Olası Çoğalt: C# '
What is the difference between the following casts in c#?C# döküm arasındaki fark?
, bir nesne döküm veya as
anahtar kelimeyi kullanarak arasındaki orada fark nedir? Umarım bu kod ... ne demek istediğimi
String text = "Hello hello";
Object obj = text;
String originalCast = ((String)obj).ToUpper();
String originalAs = (obj as String).ToUpper();
Teşekkür
:)
Tam dupe: // stackoverflow. com/questions/702234/what-is-the-c-in-the-c-cast-in-the-c-ve diğerleri çok sayıda diğerleri – annakata
http://stackoverflow.com/questions/2483/casting-newtype-vs- object-as-newtype – pirho