MaskedTextProvider.RemoveAt 方法

定义

从带格式的字符串中移除一个或多个赋值的字符。Removes one or more assigned characters from the formatted string.

重载

RemoveAt(Int32)

从带格式的字符串中移除位于指定位置的赋值字符。Removes the assigned character at the specified position from the formatted string.

RemoveAt(Int32, Int32)

从带格式的字符串中移除指定位置之间的赋值的字符。Removes the assigned characters between the specified positions from the formatted string.

RemoveAt(Int32, Int32, Int32, MaskedTextResultHint)

从带格式的字符串中移除指定位置之间的赋值的字符,然后输出移除位置和描述性信息。Removes the assigned characters between the specified positions from the formatted string, and then outputs the removal position and descriptive information.

RemoveAt(Int32)

从带格式的字符串中移除位于指定位置的赋值字符。Removes the assigned character at the specified position from the formatted string.

public:
 bool RemoveAt(int position);
public bool RemoveAt (int position);
member this.RemoveAt : int -> bool
Public Function RemoveAt (position As Integer) As Boolean

参数

position
Int32

要移除的赋值字符的位置(从零开始计)。The zero-based position of the assigned character to remove.

返回

如果该字符已成功移除,则为 true;否则为 falsetrue if the character was successfully removed; otherwise, false.

注解

如果RemoveAt在指定的删除位置没有指定的字符,则此方法不起作用。The RemoveAt method has no effect if there are no assigned characters at the removal position specified. 文本字符不受此方法的影响。Literal characters are not affected by this method.

删除字符后,掩码中的其余较高位置字符将向左移动,以填充通过删除创建的间隔。When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. 对于输入,将重置空出的位置。Vacated positions are reset for input. 如果掩码定义禁止移动字符,则不会发生移除,并RemoveAt返回。 falseIf movement of the characters is prevented by the mask definition, no removal occurs, and RemoveAt returns false.

此方法调用完全等效于对重载RemoveAt(Int32, Int32)版本的以下调用:This method call is exactly equivalent to the following call to the overloaded RemoveAt(Int32, Int32) version:

RemoveAt(pos, pos);

另请参阅

RemoveAt(Int32, Int32)

从带格式的字符串中移除指定位置之间的赋值的字符。Removes the assigned characters between the specified positions from the formatted string.

public:
 bool RemoveAt(int startPosition, int endPosition);
public bool RemoveAt (int startPosition, int endPosition);
member this.RemoveAt : int * int -> bool
Public Function RemoveAt (startPosition As Integer, endPosition As Integer) As Boolean

参数

startPosition
Int32

要移除的第一个赋值的字符的从零开始的索引。The zero-based index of the first assigned character to remove.

endPosition
Int32

要移除的最后一个赋值的字符的从零开始的索引。The zero-based index of the last assigned character to remove.

返回

如果该字符已成功移除,则为 true;否则为 falsetrue if the character was successfully removed; otherwise, false.

注解

如果RemoveAt在指定的删除位置没有指定的字符,则此方法不起作用。The RemoveAt method has no effect if there are no assigned characters at the removal positions specified.

删除字符后,掩码中的其余较高位置字符将向左移动,以填充通过删除创建的间隔。When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. 对于输入,将重置空出的位置。Vacated positions are reset for input. 如果掩码定义禁止移动字符,则不会发生移除,并RemoveAt返回。 falseIf movement of the characters is prevented by the mask definition, no removal occurs, and RemoveAt returns false.

另请参阅

RemoveAt(Int32, Int32, Int32, MaskedTextResultHint)

从带格式的字符串中移除指定位置之间的赋值的字符,然后输出移除位置和描述性信息。Removes the assigned characters between the specified positions from the formatted string, and then outputs the removal position and descriptive information.

public:
 bool RemoveAt(int startPosition, int endPosition, [Runtime::InteropServices::Out] int % testPosition, [Runtime::InteropServices::Out] System::ComponentModel::MaskedTextResultHint % resultHint);
public bool RemoveAt (int startPosition, int endPosition, out int testPosition, out System.ComponentModel.MaskedTextResultHint resultHint);
member this.RemoveAt : int * int * int * MaskedTextResultHint -> bool
Public Function RemoveAt (startPosition As Integer, endPosition As Integer, ByRef testPosition As Integer, ByRef resultHint As MaskedTextResultHint) As Boolean

参数

startPosition
Int32

要移除的第一个赋值的字符的从零开始的索引。The zero-based index of the first assigned character to remove.

endPosition
Int32

要移除的最后一个赋值的字符的从零开始的索引。The zero-based index of the last assigned character to remove.

testPosition
Int32

如果成功,则为带格式的字符串中实际移除字符的位置(从零开始计);否则为该操作第一次失败时所处的位置。If successful, the zero-based position in the formatted string of where the characters were actually removed; otherwise, the first position where the operation failed. 输出参数。An output parameter.

resultHint
MaskedTextResultHint

一个 MaskedTextResultHint,用于简单地描述操作的结果。A MaskedTextResultHint that succinctly describes the result of the operation. 输出参数。An output parameter.

返回

如果该字符已成功移除,则为 true;否则为 falsetrue if the character was successfully removed; otherwise, false.

注解

如果RemoveAt在指定的删除位置没有指定的字符,则此方法不起作用。The RemoveAt method has no effect if there are no assigned characters at the removal positions specified.

删除字符后,掩码中的其余较高位置字符将向左移动,以填充通过删除创建的间隔。When a character is removed, the remaining higher-positioned characters in the mask will shift to the left to fill in the gap created by the removal. 对于输入,将重置空出的位置。Vacated positions are reset for input. 如果掩码定义禁止移动字符,则不会发生移除,并RemoveAt返回。 falseIf movement of the characters is prevented by the mask definition, no removal occurs, and RemoveAt returns false.

此版本的RemoveAt提供了两个附加的输出参数,用于传递有关方法操作的详细信息。This version of RemoveAt provides two additional output parameters to convey more information about the operation of the method.

另请参阅

适用于