TString str = "Hello World!"; bool result = str.Contains("World"); // true
TString str = "This is a sample string"; bool result = str.Contains("not present"); // false
TString str = ""; bool result = str.Contains("Hello"); // falseIn this example, the Contains method checks whether the substring "Hello" is present in the given empty string. Since the string is empty, the result is false. The package library used for the TString class is the VCL (Visual Component Library) library in C++.