Skip to main content

startsWith

Short summary

This assertion method checks if the current string stringToCheck starts with string start. Processed strings must be in UTF-8 encoding

Parameters

NameTypeCommentKind
stringToCheckTc2_System.T_MaxStringcurrent string to checkinput
startTc2_System.T_MaxStringexpected start of stringToCheckinput
messageAssertMessagemessage if the assertion is falseinput
sbcsTypeTc2_Utilities.E_SBCSTypeused Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLEinput
ignoreCasesBOOLTRUE means ignore cases; FALSE means that cases must be equal tooinput
trimBOOLTRUE means truncation of spaces on the left side of stringToCheckinput

Code

Declaration

METHOD startsWith
VAR_INPUT
(* current string to check *)
stringToCheck :Tc2_System.T_MaxString;
(* expected start of ``stringToCheck`` *)
start :Tc2_System.T_MaxString;
(* message if the assertion is false *)
message :AssertMessage;
(* used Single Byte Character Set (SBCS), is set in Tc2_Utilities.GLOBAL_SBCS_TABLE *)
sbcsType :Tc2_Utilities.E_SBCSType := Tc2_Utilities.E_SBCSType.eSBCS_WesternEuropean;
(* ``TRUE`` means ignore cases; ``FALSE`` means that cases must be equal too *)
ignoreCases :BOOL := FALSE;
(* ``TRUE`` means truncation of spaces on the left side of ``stringToCheck``*)
trim :BOOL := FALSE;
END_VAR

Implementation

assertion.startsWith(
stringToCheck := ADR(stringToCheck),
start := ADR(start),
ignoreCases := ignoreCases,
trim := trim,
message := message,
sbcsType := sbcsType
);