Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash if substring

string='Hi substring' #To check if string has "Mylong" substring do
if [[ $string == *"substring"* ]]; then
  echo "String has substring"
fi
 
PREVIOUS NEXT
Tagged: #bash #substring
ADD COMMENT
Topic
Name
8+7 =