Shell: Cari string jika berisi string lain

# Search for a substring in another string using wildcard

string='My long string'
substr='My long'

# Note: the wildcard character (*) is outside the double qoute ("")
if [[ "$string" == *"$substr"* ]]; then
  echo "Found substring!"
fi
Famous Frog