diff options
| author | Scott Gasch <[email protected]> | 2022-03-25 10:48:13 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-03-25 10:48:13 -0700 |
| commit | 7dfe2039f7c53fc9f2621be9dd704bcb7681022f (patch) | |
| tree | dff3c300a277453b3353fe1f2c72d6c5d84635e1 /string_utils.py | |
| parent | 52ffdbae73f20b49a1451df2652a8bbc0c4dcac1 (diff) | |
Add LICENSE and NOTICE.
Diffstat (limited to 'string_utils.py')
| -rw-r--r-- | string_utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
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: |
