Return to Snippet

Revision: 9429
at November 5, 2008 18:18 by aresnick


Initial Code
string='My string';

if [[ $string == *My* ]]
then
  echo "It's there!";
fi

Initial URL
http://stackoverflow.com/questions/229551/string-contains-in-bash

Initial Description

                                

Initial Title
Checking if a string contains a substring in Bash

Initial Tags

                                

Initial Language
Bash