Last active
December 30, 2015 17:45
-
-
Save Naphier/7da8eaafa3978ca8af12 to your computer and use it in GitHub Desktop.
Strategy Pattern Example - String Output - CSVOutput
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
public class CSVOutput : IOutputStrategy | |
{ | |
char delimiter = ' '; | |
public CSVOutput(char delimiter) | |
{ | |
this.delimiter = delimiter; | |
} | |
public string Output(string input) | |
{ | |
input = input.Replace(delimiter, ','); | |
return input; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment