新手上路:
X++中的subStr: Retrieves part of a string
str subStr(str _text, int _position, int _number)
和平常我们用的SubString 不一样的是,_number 参数允许负数, 当_number < 0 时,表示从_position位置开始倒推几位.
Example:
// Returns the text string CDEFG.
subStr("ABCDEFGHIJ",3,5);
// Returns the text string DEFG.
subStr("ABCDEFGHIJ",7,-4);
Parameter |
Description |
---|---|
_text |
The original string. |
_position |
The position in _text to begin the new string. |
_number |
The number of characters to select from _position onwards. If there is a minus sign preceding _number, the system selects the substring backward from the specified position. |