Add string.sh to scripts

This commit is contained in:
John Zhao 2018-03-30 16:28:23 +08:00
parent efb6ce6f5a
commit 30b038a623

7
scripts/common/string.sh Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
[ -n "${_STRING_SH_}" ] && return || readonly _STRING_SH_=1
[ -n "${_VERBOSE_}" ] && echo "-- INCLUDE: string.sh"
_startswith() { [ "$1" != "${1#$2}" ]; }
_endswith() { [ "$1" != "${1%$2}" ]; }