util/strings.sh

Util string functions.

strings_cap()

Captilize the given string.

strings_count()

Number of substrings in the given string.

strings_escape_slash()

Return string with escaped slash chars.

strings_has()

Return true if the str has the given substring.

strings_has_prefix()

Return true if str starts with prefix.

strings_has_suffix()

Return true if str has suffix.

strings_index_of()

Return index of the first sep instance or -1 if not present.

strings_join()

Join strings using the given separator.

strings_len()

Length of the given string.

strings_lstrip()

Return string without leading white chars.

strings_pcap()

Capitlize the given string (can be used in pipes).

strings_remove_at()

Return the given string without chart at the given index.

strings_remove_char()

Remove c from the string.

strings_remove_prefix()

Return a string by removing prefix from str.

strings_remove_spaces()

Remove all spaces from the given string.

strings_repeat()

Creat a string by repeating c char n times.

strings_rev()

Reverse the given string.

strings_rstrip()

Return string without trailing white chars.

strings_single_space()

Return string where multiple spaces are merged into one.

strings_strip()

Return string without leading and trailing white chars.

strings_sub()

Return a substring between given indexes.

strings_swap_case()

Return copy of the given string and swap case letters.

strings_to_lower()

Return copy of the given string with all lower case letters.

strings_to_upper()

Return copy of the given string with all upper case letters.