- C# 7 and .NET Core 2.0 High Performance
- Ovais Mehboob Ahmed Khan
- 63字
- 2021-08-27 18:47:10
Var pattern
The var pattern checks if the var is equal to some type. The following example shows how the var pattern can be used to check for the type and print the Type name:
if (person is var Person) Console.WriteLine($"It is a person object and type is {person.GetType()}");
To learn more about patterns, you can refer to the following link: https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7#pattern-matching.
推薦閱讀
- 數(shù)據(jù)庫應(yīng)用實(shí)戰(zhàn)
- Python絕技:運(yùn)用Python成為頂級(jí)數(shù)據(jù)工程師
- Neural Network Programming with TensorFlow
- 數(shù)據(jù)庫系統(tǒng)原理及應(yīng)用教程(第4版)
- 深入淺出MySQL:數(shù)據(jù)庫開發(fā)、優(yōu)化與管理維護(hù)(第2版)
- 數(shù)據(jù)架構(gòu)與商業(yè)智能
- 數(shù)據(jù)庫技術(shù)及應(yīng)用教程
- 大數(shù)據(jù)精準(zhǔn)挖掘
- INSTANT Apple iBooks How-to
- Hadoop集群與安全
- Augmented Reality using Appcelerator Titanium Starter
- 區(qū)塊鏈+:落地場景與應(yīng)用實(shí)戰(zhàn)
- Microsoft Dynamics NAV 2015 Professional Reporting
- 大數(shù)據(jù)測試技術(shù):數(shù)據(jù)采集、分析與測試實(shí)踐(在線實(shí)驗(yàn)+在線自測)
- 數(shù)據(jù)會(huì)說話:活用數(shù)據(jù)表達(dá)、說服與決策