Skip to main content

endsWith

Short summary

This assertion method for UTF-16 strings checks if the current string stringToCheck ends with the string end

Attention: All strings are handled as null terminated word streams. For UTF-16 is end of the string 16#00_00

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

Parameters

NameTypeCommentKind
stringToCheckPOINTER TO WORDcurrent string to checkinput
endPOINTER TO WORDstring must be the end of stringToCheckinput
ignoreCasesBOOLTRUE means ignore cases; FALSE means cases must be equal tooinput
trimBOOLTRUE means truncation of spaces on the right side of stringToCheckinput
messageAssertMessagemessage if the assertion is falseinput
normalizeStringsBOOLnormalize both strings for checkinput

Code

Declaration

METHOD endsWith
VAR_INPUT
(* current string to check *)
stringToCheck :POINTER TO WORD;
(* string must be the end of ``stringToCheck`` *)
end :POINTER TO WORD;
(* ``TRUE`` means ignore cases; ``FALSE`` means cases must be equal too *)
ignoreCases :BOOL;
(* ``TRUE`` means truncation of spaces on the right side of ``stringToCheck``*)
trim :BOOL;
(* message if the assertion is false *)
message :AssertMessage;
(*normalize both strings for check*)
normalizeStrings :BOOL := TRUE;
END_VAR