This command will return true if the string has the prefix or false otherwise.
string hasprefix "frei" "freindly"
Would return true
string hasprefix "ing" "freindly"
Would return false
NOTE: To read content from standard input we use the -i -
option.
echo "freindly" | string -i - hasprefix "frei"
Would return true
echo "freindly" | string -i - hasprefix "ing"
Would return false