Copyright © 2003 - 2004 Enrique Marcote Peña
Version: 1.0, {23 Sep 2003} 12:29:46.
Authors: Enrique Marcote Peña (mpquique@users.sourceforge.net) [web site: http://www.des.udc.es/~mpquique/].
Additional functions for string processing.
aequal/2 | Approximate matching of strings. |
aequal/6 | Approximate matching of strings. |
chop_token/2 | Gets the first token in String, separated by the characters in SeparatorList. |
chop_tokens/3 | Gets the first N tokens in String, separated by the characters in SeparatorList. |
is_atime/1 | Checks if String is a representacion of an absolute time value, given in the format "YYMMDDhhmmsstnnp". |
is_dec/1 | Checks if String is a sequence of decimal digits, every character belongs to [$0, $1, $2, $3, $4, $5, $6, $7, $8, $9]. |
is_hex/1 | Checks if String is a sequence of hexadecimal digits, every character belongs to [$0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $A, $B, $C, $D, $E, $F, $a, $b, $c, $d, $e, $f]. |
is_rtime/1 | Checks if String is a representacion of a relative time value, given in the format "YYMMDDhhmmsstnnp". |
join/2 | The opposite of string:tokens/2 (sort of). |
lowercase/1 | Returns a new LString where every letter is in lowercase. |
normalize/1 | Returns a new NString where spaces are normalized. |
replace_chars/3 | Replaces on String1 every character in Characters list by Char. |
split_by_word/2 | Splits a String into two parts by a given word. |
strip/2 | Equivalent to my_string:strip(String, both, SeparatorList). |
strip/3 | Returns a string, where leading and/or trailling characters in SeparatorList have been removed. |
uppercase/1 | Returns a new UString where every letter is in uppercase. |
aequal(String::String1, Pattern::Pattern) -> Result
Approximate matching of strings. Returs true if String1 is equal to Pattern allowing 1 error (substitution, insertion, deletion or transposition).
> my_string:aequal("hello", "helo").
approximate
See also: aequal/6.
aequal(String::String, Pattern::Pattern, S::Subs, I::Ins, D::Dels, T::Trans) -> Result
Approximate matching of strings. Returs true if String is equal to Pattern allowing Subs substitution errors, Ins insertion errors, Dels deletion errors and Trans transposition errors.
See also: aequal/2.
chop_token(String::String, SeparatorList::SeparatorList) -> {Token, RestOfString}
Gets the first token in String, separated by the characters in SeparatorList.
See also: chop_tokens/3, string:sub_word/2, string:tokens/2.
chop_tokens(String::String, N::N, SeparatorList::SeparatorList) -> {Tokens, RestOfString}
Gets the first N tokens in String, separated by the characters in SeparatorList. If there are less than N tokens the tuple {AvailableTokens, "" } is returned.
See also: chop_token/2, string:sub_word/2, string:tokens/2.
is_atime(String::String) -> bool()
Checks if String is a representacion of an absolute time value, given in the format "YYMMDDhhmmsstnnp". Where
If String is empty, true is returned.
See also: is_rtime/1.
is_dec(Rest::String) -> bool()
Checks if String is a sequence of decimal digits, every character belongs to [$0, $1, $2, $3, $4, $5, $6, $7, $8, $9].
If String is empty, true is returned.
See also: is_hex/1.
is_hex(Rest::String) -> bool()
Checks if String is a sequence of hexadecimal digits, every character belongs to [$0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $A, $B, $C, $D, $E, $F, $a, $b, $c, $d, $e, $f].
If String is empty, true is returned.
See also: is_dec/1.
is_rtime(String::String) -> bool()
Checks if String is a representacion of a relative time value, given in the format "YYMMDDhhmmsstnnp". Where
If String is empty, true is returned.
See also: is_atime/1.
join(List::List, Sep::Sep) -> String
The opposite of string:tokens/2 (sort of).
Written by Per Hedeland at erlang-questions.
lowercase(String::String) -> LString
Returns a new LString where every letter is in lowercase.
See also: uppercase/1.
normalize(String::String) -> NString
Returns a new NString where spaces are normalized.
replace_chars(String::String1, Characters::Characters, Char::Char) -> String2
Replaces on String1 every character in Characters list by Char.
> replace_chars("hello_world.", "_.", $ ).
"hello world "
split_by_word(String::String, N::Number) -> {Prefix, Suffix}
Splits a String into two parts by a given word.
Prefix contains Number words and
Suffix the rest of the string. Words are separated by blanks.
String == Prefix ++ Suffix
strip(String::String, SeparatorList::SeparatorList) -> Stripped
Equivalent to my_string:strip(String, both, SeparatorList).
strip(String::String, X2::Direction, SeparatorList::SeparatorList) -> Stripped
Returns a string, where leading and/or trailling characters in SeparatorList have been removed. Direction can be left, right or both and indicates from which direction characters are to be removed. The function strip/2 is equivalent to strip(String, both, SeparatorList).
See also: string:strip/1, string:strip/2, string:strip/3.
uppercase(String::String) -> UString
Returns a new UString where every letter is in uppercase.
See also: lowercase/1.