While creating materials for my bash class I needed to create some globbing exercises for my students.
It occurred to me that a string operator and a comparison to the null string can be used to check if something is a substring of another value.
Sure, you can use Substring Expansion to see if the substring is at a known location such as "Does the value of $foo start with 'bar'?", but length and location are often unknown.
$ foo=barfood
$ if [ 'bar' = "${foo:0:3}" ]; then echo $foo; fi
barfood
$