Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
10
Добавлен:
11.10.2020
Размер:
3.39 Mб
Скачать

322 Standard Library Elements

String functions

Example in FBD:

Example in ST:

Var1 := DELETE ('SUXYSI',2,3);

Note:

String functions are not "thread safe"!

13.1.8REPLACE

REPLACE replaces a partial string from a larger string with a third string.

The input variable STR1 and STR2 are type STRING, LEN and POS are type INT, the return value of the function is type STRING.

REPLACE(STR1, STR2, L, P) means: Replace L characters from STR1 with STR2 beginning with the character in the P position.

Example in IL:

LD

'SUXYSI'

REPLACE

'K',2,2

ST

VarSTRING1 (* Ergebnis ist 'SKYSI' *)

Example in FBD:

Example in ST:

VarSTRING1 := REPLACE ('SUXYSI','K',2,2);

Note:

String functions are not "thread safe"!

13.1.9FIND

FIND searches for a partial string within a string.

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32