Skip to main content

startsWith

Short summary

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

Attention: All strings are handled as null-terminated byte streams

Parameters

NameTypeCommentKind
stringToCheckPOINTER TO BYTEcurrent string to checkinput
startPOINTER TO BYTEexpected start of stringToCheckinput
ignoreCasesBOOLTRUE means ignore cases; FALSE means that cases must be equal tooinput
trimBOOLTRUE means truncation of spaces on the left side of stringToCheckinput
messageAssertMessagemessage if the assertion is falseinput
normalizeStringsBOOLnormalize both strings for checkinput

Code

Declaration

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