Assembler.Assembler.SectionCode.ReplaceAllConstantsData C# (CSharp) Method

ReplaceAllConstantsData() private static method

Replaces all constants/(reserved/declared data) with the number representing their offset.
private static ReplaceAllConstantsData ( string strs, ushort>.Dictionary constants, int>.Dictionary data ) : string[]
strs string Lines of code for this section
constants ushort>.Dictionary Dictionary of constants
data int>.Dictionary Dictionary of declared data
return string[]
            private static string[] ReplaceAllConstantsData(string[] strs, Dictionary<string, ushort> constants, Dictionary<string, int> data)
            {
                StringBuilder sb = new StringBuilder(string.Join("\n", strs));

                foreach (var c in constants)
                    sb.Replace(c.Key, c.Value.ToString());

                foreach (var d in data)
                    sb.Replace(d.Key, d.Value.ToString());

                return sb.ToString().Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
            }