contains function

bool contains(
  1. String str,
  2. String substring
)

Function to check if the given string contains the specified substring.

Implementation

bool contains(String str, String substring) {
  // Use the `contains` method of the string class to check if `str` contains `substring`.
  // The function returns true if the substring is found, otherwise, it returns false.
  return str.contains(substring);
}