Answers for "find a string contain in another string"

2

find a string contain in another string

#!/bin/bash

STR='GNU/Linux is an operating system'
SUB='Linux'
if [[ "$STR" == *"$SUB"* ]]; then
  echo "It's there."
fi
Posted by: Guest on June-29-2020

Code answers related to "find a string contain in another string"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language