Skip to main content

Module string_utils

Module string_utils 

Source

Functions§

conv_urls
Converts URLs in text to clickable HTML links.
convchars
Replaces characters found in chars with underscores.
getconfvalue
Returns val if non-empty and not “NONE”, otherwise returns default_val.
getvalue
Returns None if the string is empty or “NONE”, otherwise returns Some.
obfuscate_email_address
Obfuscates an email address using HTML numeric character references.
oneunre
Strips a single reply/forward prefix from a subject line.
parse_url
Attempts to parse a URL from the start of a string, writing it into url.
replacechar
Replaces all occurrences of character from with string to in place.
spamify
Applies spam protection to email addresses in a string.
strcpymax
Copies at most max bytes from src into dest, respecting UTF-8 char boundaries.
stripzone
Strips trailing parenthetical timezone info from a date string.
strreplace_in
Replaces all occurrences of from with to in place.
strtolower
Converts a string to lowercase in place.
unobfuscate_email_address
Reverses HTML numeric character reference obfuscation back to plain text.
unre
Strips reply prefixes from email subjects.