Skip to main content

contains

Short summary

This assertion method for UTF-16 strings checks if the current string stringToCheck contains the search string searchString

Parameters

NameTypeCommentKind
stringToCheck( Tc2_System.MAX_STRING_LENGTH )current string to checkinput
searchString( Tc2_System.MAX_STRING_LENGTH )string must be found in stringToCheckinput
messageAssertMessagemessage if the assertion is falseinput
ignoreCasesBOOLTRUE means ignore cases; FALSE means cases must be equal tooinput
normalizeStringsBOOLnormalize both strings for checkinput

Code

Declaration

METHOD contains
VAR_INPUT
(* current string to check *)
stringToCheck :WSTRING(Tc2_System.MAX_STRING_LENGTH);
(* string must be found in ``stringToCheck`` *)
searchString :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;
(*normalize both strings for check*)
normalizeStrings :BOOL := TRUE;
END_VAR