Skip to main content

startsWith

Short summary

This assertion method checks if the current string stringToCheck starts with start

Attention: start of the string is ALWAYS the left side of the string even for writings which written from right to left like Hebrew or Arabic

Parameters

NameTypeCommentKind
stringToCheck( Tc2_System.MAX_STRING_LENGTH )current string to checkinput
start( Tc2_System.MAX_STRING_LENGTH )expected start of stringToCheckinput
messageAssertMessagemessage if the assertion is falseinput
ignoreCasesBOOLTRUE means ignore cases; FALSE means cases must be equal tooinput
trimBOOLTRUE means truncation of spaces on the left side of stringToCheckinput
normalizeStringsBOOLnormalize both strings for checkinput

Code

Declaration

METHOD startsWith
VAR_INPUT
(* current string to check *)
stringToCheck :WSTRING(Tc2_System.MAX_STRING_LENGTH);
(* expected start of ``stringToCheck`` *)
start :WSTRING(Tc2_System.MAX_STRING_LENGTH);
(* message if the assertion is false *)
message :AssertMessage;
(* ``TRUE`` means ignore cases; ``FALSE`` means cases must be equal too *)
ignoreCases :BOOL := FALSE;
(* ``TRUE`` means truncation of spaces on the left side of ``stringToCheck``*)
trim :BOOL := FALSE;
(*normalize both strings for check*)
normalizeStrings :BOOL := TRUE;
END_VAR