Este é um blog onde anoto dicas técnicas de informática e computação.
This is a blog where I write down technical tips on computing.
Be aware that some resources used in this blog may use cookies to collect information used by Ads and Google Analytics. I do not monetize from this website, neither require or use personal information.
Saturday, January 21, 2017
IndexOf Subtring in String
function indexOf {
local a=$1;
local b=$2;
echo $(($(expr match "$a" ".*${b}") - $(expr length "$b")))
}
No comments:
Post a Comment