str_repeat()

# str_repeat() -- Repeat a string
# Usage: str_repeat input multiplier
# depend: is_num(): http://www.ronggeng.net/index.php/2009/04/24/is_num/
#
# Example:
#
# str_repeat "test test test" 10;
#

str_repeat() {
	[ $# -eq 2 ] || return 1;
	! is_num "$2" && return 1;
	local _cnt _ret="";
	while ((_cnt < $2 )); do
		_ret+="$1";
		((_cnt++));
        done;
	echo "$_ret";
	return 0;
}