We could format item from
string
array
and add back to the
Dictionary
, please see below code,
public static IDictionary<string, int> StringFormmater = new Dictionary<string, int>()
{
};
static void Main(string[] args)
{
string[] stringArray = { "C# {0} and {1}", "FrameWork {0} and {1}" };
Array.ForEach(stringArray, item =>
{
StringFormmater.Add(string.Format(item, "Injected","From For loop"), item.Length);
});
}
:)