F_RTrim

 F_RTrim 1:

The F_RTrim function removes spaces on the right side of a string.

FUNCTION F_RTrim : T_MaxString

T_MaxString

VAR_INPUT

VAR_INPUT
    in      :T_MaxString;
END_VAR

 

Example:

PROGRAM MAIN
VAR
    sRTrim  : STRING;
    sLRTrim : STRING;
END_VAR
sRTrim := F_RTrim(' trim> '); (* result: ' trim>' *)
sRTrim := F_RTrim('trim> '); (* result: 'trim>' *)
sRTrim := F_RTrim('trim>'); (* result: 'trim>' *)
sRTrim := F_RTrim(''); (* result: '' *)

sLRTrim := F_RTrim( F_LTrim( ' <trim> ')); (* result: '<trim>' *)

 

Requirements

Development environment

Target System

PLC libraries to include

TwinCAT v2.10.0 Build > 1323

PC or CX (x86, ARM)

TcUtilities.Lib