Skip to content

Instantly share code, notes, and snippets.

@Naphier
Last active December 30, 2015 17:45
Show Gist options
  • Save Naphier/7da8eaafa3978ca8af12 to your computer and use it in GitHub Desktop.
Save Naphier/7da8eaafa3978ca8af12 to your computer and use it in GitHub Desktop.
Strategy Pattern Example - String Output - CSVOutput
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