Module z_string

String related functions.

Copyright © 2009-2010 Marc Worrell Date: 2009-04-26

Authors: Marc Worrell (marc@worrell.nl).

Description

String related functions

Function Index

contains/2Return true iff What is found in the string.
ends_with/2Return true iff Word ends with End.
escape_ical/1Escape special characters for ical RFC2445 elements.
first_char/1Return the first character of a string.
is_string/1Check if the variable is a one dimensional list, probably a string.
last_char/1Return the last character of a string.
line/1Make sure that the string is on one line only, replace control characters with spaces.
nospaces/1Remove all spaces and control characters from a string.
replace/3Replace a string inside another string Copyright 2008 Rusty Klophaus (Nitrogen, MIT License).
split_lines/1Split the binary into lines.
starts_with/2Return true if Start is a prefix of Word.
test/0
to_lower/1Return a lowercase string for the input.
to_name/1Map a string to a value that can be used as a name or slug.
to_rootname/1Filter a filename so that we obtain a basename that is safe to use.
to_slug/1Map a string to a slug that can be used in the uri of a page.
to_upper/1Return a uppercase string for the input.
trim/1Remove whitespace at the start and end of the string.
trim/2Remove all occurences of a character at the start and end of a string.
trim_left/1Remove whitespace at the start the string.
trim_left/2Remove all occurences of a char at the start of a string.
trim_left_func/2
trim_right/1Remove whitespace at the end of the string.
trim_right/2Remove all occurences of a char at the end of the string.
truncate/2Truncate a string.
truncate/3
truncatewords/2
truncatewords/3
unquote/1Remove the first and last char if they are double quotes.
unquote/2

Function Details

contains/2

contains(What::String, B::String) -> bool()

Return true iff What is found in the string

ends_with/2

ends_with(End::String, B::String) -> bool()

Return true iff Word ends with End

escape_ical/1

escape_ical(L) -> any()

Escape special characters for ical RFC2445 elements

first_char/1

first_char(T) -> any()

Return the first character of a string.

is_string/1

is_string(Rest) -> any()

Check if the variable is a one dimensional list, probably a string

last_char/1

last_char(R) -> any()

Return the last character of a string

line/1

line(B) -> any()

Make sure that the string is on one line only, replace control characters with spaces

nospaces/1

nospaces(B) -> any()

Remove all spaces and control characters from a string.

replace/3

replace(String, S1, S2) -> any()

Replace a string inside another string Copyright 2008 Rusty Klophaus (Nitrogen, MIT License)

split_lines/1

split_lines(B) -> any()

Split the binary into lines. Line separators can be \r, \n or \r\n.

starts_with/2

starts_with(Start::String, B::String) -> bool()

Return true if Start is a prefix of Word

test/0

test() -> any()

to_lower/1

to_lower(B::Value) -> String

Return a lowercase string for the input

to_name/1

to_name(Name::String) -> String

Map a string to a value that can be used as a name or slug. Maps all characters to lowercase and remove non digalpha chars

to_rootname/1

to_rootname(Filename::string()) -> string()

Filter a filename so that we obtain a basename that is safe to use.

to_slug/1

to_slug(Title::String) -> String

Map a string to a slug that can be used in the uri of a page. Same as a name, but then with dashes instead of underscores.

to_upper/1

to_upper(B::Value) -> String

Return a uppercase string for the input

trim/1

trim(B) -> any()

Remove whitespace at the start and end of the string

trim/2

trim(B, Char) -> any()

Remove all occurences of a character at the start and end of a string.

trim_left/1

trim_left(S) -> any()

Remove whitespace at the start the string

trim_left/2

trim_left(S, Char) -> any()

Remove all occurences of a char at the start of a string

trim_left_func/2

trim_left_func(Bin, F) -> any()

trim_right/1

trim_right(B) -> any()

Remove whitespace at the end of the string

trim_right/2

trim_right(B, Char) -> any()

Remove all occurences of a char at the end of the string

truncate/2

truncate(L::String, N::int()) -> String

Truncate a string. Append the '...' character at the place of break off.

truncate/3

truncate(B, N, Append) -> any()

truncatewords/2

truncatewords(S, Words) -> any()

truncatewords/3

truncatewords(S, Words, Append) -> any()

unquote/1

unquote(S) -> any()

Remove the first and last char if they are double quotes.

unquote/2

unquote(S, Q) -> any()


Generated by EDoc, Feb 25 2011, 21:14:41.