Text.DelStr(Text, Integer [, Integer]) Method
Version: Available or changed with runtime version 1.0.
Deletes a substring inside a string (text or code).
Syntax
NewString := Text.DelStr(String: Text, Position: Integer [, Length: Integer])
Note
This method can be invoked without specifying the data type name.
Parameters
String
Type: Text
The input string.
Position
Type: Integer
The position of the first character that you want to delete. Position must be greater than zero (0). If Position exceeds the length of String, DELSTR returns the original string, unchanged.
[Optional] Length
Type: Integer
Specifies how many characters to delete. Length must be greater than zero (0).
Return Value
NewString
Type: Text
The input string without the specified substring.
Remarks
If you omit Length, all the characters starting with Position are deleted until the end of the string.
If you omit Length and Position is less than 1, then an error is returned.
If you omit Length and Position is greater than the length of String, then String is returned unchanged.
Example
var
Str: Text[40];
NewStr: Text[40];
Position: Integer;
Length: Integer;
Text000: TexConst ENU='Adjusting prices - Please wait.';
Text001: TexConst ENU='The original string:>%1<';
Text002: TexConst ENU='The original modified:>%2<';
begin
Str := Text000;
Position := 11; // Remove the word 'prices' and a blank.
Length := 7;
NewStr := DelStr(Str, Position, Length);
Message(Text001, Str);
Message(Text002, NewStr);
end;
The first message window displays the following:
The original string:
>Adjusting prices - Please wait.<
The second message window displays the following:
The modified string:
>Adjusting - Please wait.<
See Also
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기