Opc.Ua.Com.Client.ParsedNodeId.EscapeAndAppendString C# (CSharp) Method

EscapeAndAppendString() protected static method

Escapes and appends a string.
protected static EscapeAndAppendString ( StringBuilder buffer, string text ) : void
buffer StringBuilder The buffer.
text string The text.
return void
        protected static void EscapeAndAppendString(StringBuilder buffer, string text, params char[] specialChars)
        {
            // add the root identifier.
            if (text != null)
            {
                for (int ii = 0; ii < text.Length; ii++)
                {
                    char ch = text[ii];

                    // escape any special characters.
                    for (int jj = 0; jj < specialChars.Length; jj++)
                    {
                        if (specialChars[jj] == ch)
                        {
                            buffer.Append(specialChars[0]);
                        }
                    }

                    buffer.Append(ch);
                }
            }
        }