The string check activity can be used to validate various things about strings
Activity properties
Most checks in the string check activity have to option to be case sensitive.
This options results in different Delphi function, for example, SameStr if case sensitive, and SameText if case not sensitive when using the Equals function.
Possible checks:
Example:
StringToCheck = "Hello World"
StringToCompare = "world"
Is case sensitive = True
begin var var IsSameString: Boolean; IsSameString := SameStr(StringToCompare, StringToCheck); end; |
Result = False
Example:
StringToCheck = "Hello World"
StringToCompare = "world"
Is case sensitive = False
begin var var IsSameString: Boolean; IsSameString := ContainsText(StringToCompare, StringToCheck); end; |
Result = True
Example:
StringToCheck = "Hello World"
StringToCompare = "world"
Is case sensitive = True
begin var var IsSameString: Boolean; IsSameString := EndsStr(StringToCompare, StringToCheck); end; |
Result = False
Starts with / case insensitive
Example:
StringToCheck = "Hello World"
StringToCompare = "hello"
Is case sensitive = False
begin var var IsSameString: Boolean; IsSameString := EndsStr(StringToCompare, StringToCheck); end; |
Result = True
Example:
StringToCheck = "Hello World"
begin var var IsSameString: Boolean; IsSameString := StringToCheck.Trim.IsEmpty; end; |
Result = False