XmlNameTable.Add 方法

定义

当在派生类中被重写时,将指定的字符串原子化并将其添加到 XmlNameTableWhen overridden in a derived class, atomizes the specified string and adds it to the XmlNameTable.

重载

Add(String)

当在派生类中被重写时,将指定的字符串原子化并将其添加到 XmlNameTableWhen overridden in a derived class, atomizes the specified string and adds it to the XmlNameTable.

Add(Char[], Int32, Int32)

当在派生类中被重写时,将指定的字符串原子化并将其添加到 XmlNameTableWhen overridden in a derived class, atomizes the specified string and adds it to the XmlNameTable.

注解

有关原子化字符串的详细信息,请参阅 XmlNameTableFor more information on atomized strings, see XmlNameTable.

Add(String)

当在派生类中被重写时,将指定的字符串原子化并将其添加到 XmlNameTableWhen overridden in a derived class, atomizes the specified string and adds it to the XmlNameTable.

public:
 abstract System::String ^ Add(System::String ^ array);
public abstract string Add (string array);
abstract member Add : string -> string
Public MustOverride Function Add (array As String) As String

参数

array
String

要添加的名称。The name to add.

返回

String

新的原子化字符串;如果已存在原子化字符串,则为此现有的原子化字符串。The new atomized string or the existing one if it already exists.

例外

arraynullarray is null.

注解

有关原子化字符串的详细信息,请参阅 XmlNameTableFor more information on atomized strings, see XmlNameTable.

适用于

Add(Char[], Int32, Int32)

当在派生类中被重写时,将指定的字符串原子化并将其添加到 XmlNameTableWhen overridden in a derived class, atomizes the specified string and adds it to the XmlNameTable.

public:
 abstract System::String ^ Add(cli::array <char> ^ array, int offset, int length);
public abstract string Add (char[] array, int offset, int length);
abstract member Add : char[] * int * int -> string
Public MustOverride Function Add (array As Char(), offset As Integer, length As Integer) As String

参数

array
Char[]

包含要添加的名称的字符数组。The character array containing the name to add.

offset
Int32

数组中指定名称第一个字符的从零开始的索引。Zero-based index into the array specifying the first character of the name.

length
Int32

名称中的字符数。The number of characters in the name.

返回

String

新的原子化字符串;如果已存在原子化字符串,则为此现有的原子化字符串。The new atomized string or the existing one if it already exists. 如果 length 为零,则返回 String.Empty。If length is zero, String.Empty is returned.

例外

0 > offset0 > offset

- 或 --or- offset >= array.Lengthoffset >= array.Length - 或 --or- length > array.Lengthlength > array.Length 如果 length =0,则上述条件不会导致引发异常。The above conditions do not cause an exception to be thrown if length =0.

length < 0。length < 0.

注解

有关原子化字符串的详细信息,请参阅 XmlNameTableFor more information on atomized strings, see XmlNameTable.

适用于