Last active
March 27, 2019 18:33
-
-
Save Renerick/5dc3a00b5095f677b41ca6bea9c6d24e 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
| private static void Main() | |
| { | |
| var reader = | |
| new StringReader(" Hello world! asd!lfkj ...d ...ю...d .. lasdfj']al skdfj.lask ;! k lkj "); | |
| var writer = new StringWriter(); | |
| CharacterInfo c; | |
| State state = State.TrailingSpaces; | |
| c = reader.ReadChar(); | |
| while (c.Type != CharacterType.End) | |
| { | |
| var result = Table[state][c.Type]; | |
| writer.Write(result.f(c)); | |
| state = result.s; | |
| c = reader.ReadChar(); | |
| } | |
| Console.WriteLine(writer.ToString()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment