using System.Collections.Generic;
public static void Main()
IDictionary<string, string> dict = new Dictionary<string, string>();
IEnumerable<string> pid = "Neil Stevens".Split(' ').Append("Neil Stevens").Append("neil.stevens@capp.co");
dict.Add("note1", "This is some note with the name Neil Stevens");
dict.Add("note2", "This note has the email neil.stevens@capp.co");
Console.WriteLine(s.Value);
public static class DictionaryExtensions
public static void Anonymise(this IDictionary<string, string> dictionary, IEnumerable<string> pid)
foreach (var key in dictionary.Keys)
var value = dictionary[key].Anonymise(pid);
public static class StringExtensions
public static string Anonymise(this string data, IEnumerable<string> pid)
if (string.IsNullOrWhiteSpace(data))
data = data.Replace(s, "*****");