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

ChangeFromHex() private static method

Search through the entire section, change each hex value to an ordinary one then return the changed lines of code
private static ChangeFromHex ( string strs ) : string[]
strs string Lines of code for this section
return string[]
            private static string[] ChangeFromHex(string[] strs)
            {
                StringBuilder sb = new StringBuilder(string.Join("\n", strs));

                Regex hex = new Regex(@"([0-9A-F]{1,4})h");
                int removedChars = 0;
                foreach (Match match in hex.Matches(sb.ToString()))
                {
                    sb.Remove(match.Index - removedChars, match.Length);
                    string replacement = Convert.ToUInt16(match.Groups[1].Value, 16).ToString();
                    sb.Insert(match.Index - removedChars, replacement);
                    removedChars += match.Length - replacement.Length;
                }

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