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

