Table 29 - Standard character string functions
No.
Graphical form
a
Explanation/example
1
+-----+
ANY_STRING--| LEN |--ANY_INT
+-----+
String length function
Example:
A := LEN('ASTRING');
is equivalent to A := 7;
2
+------+
| LEFT |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
+------+
Leftmost L characters of IN
Example:
A := LEFT(IN:='ASTR',L:=3);
is equivalent to
A := 'AST' ;
3
+-------+
| RIGHT |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
+-------+
Rightmost L characters of IN
Example:
A := RIGHT(IN:='ASTR',L:=3);
is equivalent to
A := 'STR' ;
4
+-------+
| MID |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
ANY_INT-----|P |
+-------+
L characters of IN,
beginning at the P-th
Example:
A := MID(IN:='ASTR',L:=2,P:=2);
is equivalent to
A := 'ST' ;
5
+--------+
| CONCAT |
ANY_STRING---| |--ANY_STRING
: ---| |
ANY_STRING---| |
+--------+
Extensible concatenation
Example:
A := CONCAT('AB','CD','E') ;
is equivalent to
A := 'ABCDE' ;
6
+--------+
| INSERT |
ANY_STRING--|IN1 |--ANY_STRING
ANY_STRING--|IN2 |
ANY_INT-----|P |
+--------+
Insert IN2 into IN1 after the
P-th character position
Example:
A:=INSERT(IN1:='ABC',IN2:='XY',P=2
);
is equivalent to
A := 'ABXYC' ;
7
+--------+
| DELETE |
ANY_STRING--|IN |--ANY_STRING
ANY_INT-----|L |
ANY_INT-----|P |
+--------+
Delete L characters of IN, beginning
at the P-th character position
Example:
A := DELETE(IN:='ABXYC',L:=2,
P:=3) ;
is equivalent to
A := 'ABC' ;
Copyright International Electrotechnical Commission
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---
– 64 –
61131-3
IEC:2003(E)
Do'stlaringiz bilan baham: |