DELETE¶
Deletes characters from a string.
Signature¶
┌─────────┐
IN ─┤ │
L ─┤ DELETE ├─ OUT
P ─┤ │
└─────────┘
FUNCTION DELETE : ANY_STRING
VAR_INPUT
IN : ANY_STRING;
L : ANY_INT;
P : ANY_INT;
END_VAR
END_FUNCTION
The return type matches the type of IN. DELETE accepts STRING
for IN; L and P are INT.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
The source string. |
|
|
Number of characters to delete. |
|
|
Starting position (1-based). |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
IN with L characters removed starting at position P. Same type as IN. |
Description¶
DELETE(IN, L, P) deletes L characters from IN starting at
position P. Positions are 1-based.
Example¶
result := DELETE('Hello World', 6, 6); (* result = 'Hello' *)
result := DELETE('ABCDE', 2, 2); (* result = 'ADE' *)
See Also¶
References¶
IEC 61131-3 §2.5.1.5.7