Answers for "checking if a substring exists in a string bash"

3

checking if a substring exists in a string bash

string='Haystack';

if [[ $string =~ "Needle" ]]
then
   echo "It's there!"
fi
Posted by: Guest on April-06-2020

Code answers related to "checking if a substring exists in a string bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language