A General Use Python Tookit.
Project description
PyToolkit
Python General tools
Utilities
string_or_list
function allows you to interpret a string and return a list. Provides you the option of adding a delimeter using an OR function to return a possible string that you may be expecting possible commond delimeters. Such as: ",|:|\|, "
.
Example:
>>> from pytoolkit.utils import string_or_list
>>> test = 'string1,string2 string3|string4'
>>> string_or_list(test)
['string1,string2 string3|string4']
>>> string_or_list(test,delimeters=',| ')
['string1', 'string2', 'string3|string4']
>>> string_or_list(test,delimeters=',| |\|')
['string1', 'string2', 'string3', 'string4']
Releases
v0.0.3
- Added delimeter option.
- Allows you to specify the delimeter you want to use using an OR operation with
|
.
- Allows you to specify the delimeter you want to use using an OR operation with
- WARNING: this changes the default behavior to the original intent of turning a string to a string without using the default split(',').
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytoolkit928-0.0.3.tar.gz
(44.4 kB
view hashes)
Built Distribution
Close
Hashes for pytoolkit928-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d27b5856a81ab30bcb75191b91537386e0c0aa6510b81754c46199b57481d686 |
|
MD5 | 9fff665b5dbce3022829eec9d39bbb4a |
|
BLAKE2b-256 | 26f55e280e7146d28e73e175760fe3b15d799adf13ae914f8f82bdb6afdce49b |