From 30b038a623db67a50f2d1f1ff9e63f46339db515 Mon Sep 17 00:00:00 2001 From: John Zhao Date: Fri, 30 Mar 2018 16:28:23 +0800 Subject: [PATCH] Add string.sh to scripts --- scripts/common/string.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/common/string.sh diff --git a/scripts/common/string.sh b/scripts/common/string.sh new file mode 100644 index 0000000..13f89b3 --- /dev/null +++ b/scripts/common/string.sh @@ -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}" ]; }