These are functions for manipulating strings used by OpenFlax.
They should only be used by OpenFlax; for general-purpose versions
of these functions, see the ce_string, ce_lists
and ce_lib modules of the ce application.
| chomp/1 | Removes all newlines from the end of a string. |
| decode_hex/1 | Parses the given string as an integer in hexadecimal notation. |
| from_datetime_rfc_1123/0 | Equivalent to from_datetime_rfc_1123(calendar:universal_time()). |
| from_datetime_rfc_1123/1 | Returns a date/time string formatted in accordance to RFC 1123. |
| from_header/1 | Given an HTTP-header format string such as "Content-Type", returns
a string suitable for easy use as an atom (content_type.). |
| from_term/1 | Tries to convert any term into a string. |
| join/2 | Joins strings with a delimeter between each part. |
| keyvalue/2 | Gets the key and value from a line of text. |
| substitute/3 | Returns a string with the all characters equal to the first argument replaced with the second argument. |
| to_atom/1 | Tries to convert a string into an atom. |
| to_caps/1 | Capitalizes each letter that is not preceded by a letter. |
| to_header/1 | Given an string such as "content_type", returns a string suitable for use as an HTTP-header field name ("Content-Type".). |
| to_lower/1 | Converts the given string to all lowercase. |
| to_upper/1 | Converts the given string to all uppercase. |
| truncate/1 | Returns a string containing all but the last character of a given string. |
chomp(List::string()) -> string()
Removes all newlines from the end of a string. Should work on both 'nix and MS-DOS newlines.
decode_hex(String::string()) -> integer()
Parses the given string as an integer in hexadecimal notation.
from_datetime_rfc_1123() -> string()
Equivalent to from_datetime_rfc_1123(calendar:universal_time()).
from_datetime_rfc_1123(X1::{date(), time()}) -> string()
Returns a date/time string formatted in accordance to RFC 1123. This sort of date/time looks like "Sun, 06 Nov 1994 08:23:19 GMT".
from_header(String::string()) -> string()
Given an HTTP-header format string such as "Content-Type", returns
a string suitable for easy use as an atom (content_type.)
from_term(F::term()) -> string()
Tries to convert any term into a string.
join(P::string(), L::[string()]) -> string()
Joins strings with a delimeter between each part.
keyvalue(String::string(), Delim::string()) -> {string(), string()}
Gets the key and value from a line of text. Can be used to parse simple mail headers, http headers, etc.
substitute(A::char(), B::char(), L::string()) -> string()
Returns a string with the all characters equal to the first argument replaced with the second argument.
to_atom(String::string()) -> atom()
Tries to convert a string into an atom.
to_caps(S::string() | atom()) -> string()
Capitalizes each letter that is not preceded by a letter.
to_header(String::string()) -> string()
Given an string such as "content_type", returns a string suitable for use as an HTTP-header field name ("Content-Type".)
to_lower(String::string()) -> string()
Converts the given string to all lowercase.
to_upper(String::string()) -> string()
Converts the given string to all uppercase.
truncate(T::string()) -> string()
Returns a string containing all but the last character of a given string.