方式一:
string='My string'; if [[ $string =~ "My" ]];then echo "It's there!" fi
方式二:
string='My long string' if [[ $string == *"My long"* ]]; then echo "It's there!" fi
2022-11-10 09:27:21
方式一:
string='My string'; if [[ $string =~ "My" ]];then echo "It's there!" fi
方式二:
string='My long string' if [[ $string == *"My long"* ]]; then echo "It's there!" fi
下一篇:模板字符串