From 5b489aaffa73884e6ce4d58134fbdd5bc4aa16ea Mon Sep 17 00:00:00 2001 From: Evaldas Date: Tue, 11 Dec 2018 01:08:53 +0200 Subject: [PATCH] Add example (#24406) * Add example Added an example of how to use is keyword * Fixed error in syntax highlighting --- guide/english/csharp/is/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guide/english/csharp/is/index.md b/guide/english/csharp/is/index.md index 3a3e1ee405..ca7fc638b7 100644 --- a/guide/english/csharp/is/index.md +++ b/guide/english/csharp/is/index.md @@ -5,5 +5,13 @@ title: is ## is The `is` keyword checks if an object is compatible with a given type, or (starting with C# 7) tests an expression against a pattern. +## Example +```csharp + int number = 6; + Console.WriteLine(number is long); // False + Console.WriteLine(number is double); // False + Console.WriteLine(number is int); // True +``` + #### More information: - [C# Reference: is](https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/is)