Created
January 3, 2020 22:56
-
-
Save controlflow/b53d28ed8fac9429ad031215db39f358 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = obj as string; | |
if (str != null) { | |
WriteLine(str.Length); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (obj is string str) { | |
WriteLine(str.Length); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment