For example,
Lets say group.SupportedProducts is [“test”, “hello”, “world”]
var products = (string[]) group.SupportedProducts;
results in “products” correctly being a string array which contains the above 3 elements – “test”, “hello” and “world”
However,
var products= group.SupportedProducts as string[];
results in products being null.
Presumably
group.SupportedProductsisn’t actually astring[], but it’s something which supports a custom conversion tostring[].asnever invokes custom conversions, whereas casting does.Sample to demonstrate this: