Files
HundM_Fortna/1_BaseSystemLib/100_Common/HelperFunctions/FC_RemoveStringPart.scl
T
2026-06-29 16:28:48 +02:00

28 lines
540 B
Plaintext

FUNCTION "FC_RemoveStringPart" : String
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
sSource : String;
sRemove : String;
END_VAR
VAR_TEMP
nLen : Int;
nPos : Int;
END_VAR
BEGIN
#nLen := LEN(#sRemove);
#nPos := FIND(IN1:=#sSource, IN2:=#sRemove);
IF #nPos > 0 THEN
#FC_RemoveStringPart := DELETE(IN := #sSource,
L := #nLen,
P := #nPos);
ELSE
#FC_RemoveStringPart := #sSource;
END_IF;
END_FUNCTION