Created
September 5, 2012 19:43
-
-
Save klmr/3643325 to your computer and use it in GitHub Desktop.
Simple pattern-based matcher for C#
This file contains 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 result = 42.Match() | |
.With(13, x => "thirteen") | |
.WithRange(13, 42, x => "between 13 and 42") | |
.WithRange(42, 45, x => "between 42 and 45") | |
.Default(x => "not found") | |
.Get<string>(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment