Copyright © 2009 Mr Buzz, Inc.
Authors: Jacob Perkins.
| encode_utf8/1 | Encode a string as utf-8. |
| is_upper/1 | Tests if String is upper case. |
| is_utf8/1 | Test if string is utf-8 encoded. |
| join/2 | |
| lcs_len/2 | Return length of the longest common subsequence (lcs) between two lists. |
| partial_match/2 | Tests if two strings are similar using prefix and suffix matching. |
| querydecode/1 | Decode a url query string. |
| random/1 | Returns a random alphanumeric string of length Size. |
| read_file/1 | Returns the contents of file as a list. |
| replace/3 | Replace first instance of Key in String with Val. |
| replace_all/3 | Replaces all instances of Key in String with Val. |
| similar/2 | Test if two strings are similar using the ratio of the lcs_len divided by length of the shortest string. |
| split/2 | Splits String at first instance of Sep. |
| splitc/2 | Faster, character based version of split/2. |
| strip/1 | Strips newline and whitespace characters from String. |
| strip_all/2 | Strip all characters from both ends of string. |
| striptokens/1 | Tokenize the string, then strip each token. |
| striptokens/2 | Tokenize the string with separators, then strip each token. |
| title_word/1 | Title case word by converting first character to upper case and rest of characters to lower case. |
| to_title/1 | Title cases String, calling title_word/1 on each word. |
| tokenize/2 | Return a list containing tokens from each string. |
| urldecode/1 | Decode the query part of a url. |
| utf8_to_unicode/1 | Convert a utf-8 string to unicode. |
encode_utf8() -> term()
Equivalent to xmerl_ucs:to_utf8(String).
Encode a string as utf-8.
is_upper(String::string()) -> bool()
Tests if String is upper case.
See also: string:to_upper/1.
is_utf8(String::string()) -> bool()
Test if string is utf-8 encoded.
See also: xmerl_ucs:is_incharset/2.
join() -> term()
lcs_len(A::list(), B::list()) -> integer()
Return length of the longest common subsequence (lcs) between two lists. Use this function to find out how similar two strings are. Think of the lcs_len as the 'edit distance' between two strings, meaning the number of edits required to go from one string to the other.
partial_match(B::string(), A::string()) -> bool()
Tests if two strings are similar using prefix and suffix matching. The strings are similar if A is a prefix or suffix of B. This function is an interim replacement for similar/2 until lcs_len/2 is optimized.
querydecode(Query::string()) -> [{string(), string()}]
Decode a url query string.
See also: split/2.
random(Size::integer()) -> string()
Returns a random alphanumeric string of length Size.
See also: emath:random/1.
read_file(Filename::string()) -> list()
Returns the contents of file as a list.
See also: file:read_file/1.
replace(String::string(), Key::string(), Val::string()) -> Result
Replace first instance of Key in String with Val. Returns {error, notfound} if Key is not in String.
replace_all(String::string(), Key::string(), Val::string()) -> {ok, string()}
Replaces all instances of Key in String with Val. If there are no instances of Key in String, then will return {ok, String}.
See also: replace/3.
similar(A::string(), B::string()) -> bool()
Test if two strings are similar using the ratio of the lcs_len divided by length of the shortest string. Strings are lowercased before comparing.
See also: lcs_len/2.
split(S::string(), Sep::string()) -> [string() | string()]
Splits String at first instance of Sep. This is an alternative to string:tokens that is much more efficient if you know that you only need to split once. Fails if Sep is not found in String.
See also: string:tokens/2.
splitc(S::string(), C::char()) -> {string(), string()}
Faster, character based version of split/2.
strip(String::string()) -> string()
Strips newline and whitespace characters from String. string:strip only strips whitespace by default.
See also: string:strip/1, string:strip/3.
strip_all(String::string(), Chars::[char()]) -> string()
Strip all characters from both ends of string.
See also: string:strip/3.
striptokens(String::string()) -> [string()]
Equivalent to striptokens(String, ",").
Tokenize the string, then strip each token.
striptokens(String::string(), Sep::string()) -> [string()]
Tokenize the string with separators, then strip each token.
See also: string:tokens/2.
title_word(Rest::string()) -> string()
Title case word by converting first character to upper case and rest of characters to lower case.
See also: string:to_lower/1, string:to_upper/1.
to_title(String::string()) -> string()
Title cases String, calling title_word/1 on each word.
See also: title_word/1.
tokenize(Strings::[string()], Sep::string()) -> [string()]
Return a list containing tokens from each string.
See also: string:tokens/2.
urldecode(URL::string()) -> [{string(), string()}]
Decode the query part of a url.
See also: querydecode/1.
utf8_to_unicode() -> term()
Equivalent to xmerl_ucs:to_unicode(String, 'utf-8').
Convert a utf-8 string to unicode.
Generated by EDoc, Jul 14 2009, 14:06:01.