From 7dfe2039f7c53fc9f2621be9dd704bcb7681022f Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Fri, 25 Mar 2022 10:48:13 -0700 Subject: Add LICENSE and NOTICE. --- string_utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'string_utils.py') diff --git a/string_utils.py b/string_utils.py index 0899576..a2f4633 100644 --- a/string_utils.py +++ b/string_utils.py @@ -857,6 +857,10 @@ def words_count(in_str: str) -> int: return len(WORDS_COUNT_RE.findall(in_str)) +def word_count(in_str: str) -> int: + return words_count(in_str) + + def generate_uuid(omit_dashes: bool = False) -> str: """ Generated an UUID string (using `uuid.uuid4()`). @@ -876,7 +880,9 @@ def generate_random_alphanumeric_string(size: int) -> str: Returns a string of the specified size containing random characters (uppercase/lowercase ascii letters and digits). - random_string(9) # possible output: "cx3QQbzYg" + >>> random.seed(22) + >>> generate_random_alphanumeric_string(9) + '96ipbNClS' """ if size < 1: -- cgit v1.3