endsWith
Short summary
This assertion method for UTF-16 strings checks if the current string stringToCheck ends with the string end
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
| Name | Type | Comment | Kind |
|---|---|---|---|
| stringToCheck | ( Tc2_System.MAX_STRING_LENGTH ) | current string to check | input |
| end | ( Tc2_System.MAX_STRING_LENGTH ) | expected end of stringToCheck | input |
| message | AssertMessage | message if the assertion is false | input |
| ignoreCases | BOOL | TRUE means ignore cases; FALSE means cases must be equal too | input |
| trim | BOOL | TRUE means truncation of white-space on the right side of stringToCheck | input |
| normalizeStrings | BOOL | normalize both strings for check | input |
Code
Declaration
METHOD endsWith
VAR_INPUT
(* current string to check *)
stringToCheck :WSTRING(Tc2_System.MAX_STRING_LENGTH);
(* expected end of ``stringToCheck`` *)
end :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 white-space on the right side of ``stringToCheck``*)
trim :BOOL := FALSE;
(*normalize both strings for check*)
normalizeStrings :BOOL := TRUE;
END_VAR
Implementation
THIS^.assertion.endsWith(
stringToCheck := ADR(stringToCheck),
end := ADR(end),
ignoreCases := ignoreCases,
trim := trim,
message := message,
normalizeStrings := normalizeStrings
);