AssertContains
The AssertContains method can be used to check whether a substring is present in another string. If this is not the case, a corresponding error message (sMessage) is passed.
Syntax
METHOD PUBLIC AssertContains
VAR_INPUT
sHaystack : STRING(255);
sNeddle : STRING(255);
sMessage : STRING(255);
END_VAR
Inputs
|
Name |
Type |
Description |
|---|---|---|
|
sHaystack |
STRING(255) |
STRING to be searched. |
|
sNeedle |
STRING(255) |
Substring being searched for |
|
sMessage |
STRING(255) |
Error message to be passed |
Sample
AssertContains(sHaystack:='the string to search in',sNeedle:='the substring to search for',sMessage:=' Error message to be displayed in the client!');