Author: | Adrián Pérez <aperez@udc.es> |
---|---|
Copyright: | 2008-2009 Igalia S.L. |
License: | GPL3 |
Abstract
Provides common functions used to manipulate text strings.
Contents
string_startswith text prefix
Checks whether a string starts with a given prefix. Exit status is non-zero if the condition is not met.
string_endswith text suffix
Checks whether a string ends with a given suffix. Exit status is non-zero if the condition is not met.
string_ascii_code text [ format ]
Returns the ASCII code of the first character of the a string. Output is in decimal by default, but the behaviour can be changed by passing the format option, whose valid values are:
string_ascii text [ separator ] [ format ]
Returns ASCII codes for all characters in a string. Output is in decimal by default, but format can be changed using the same specifiers as for the string_ascii_code function. ASCII codes will be separated using the given separator string. You can pass an empty string to join the ASCII codes.
string_contains text substring
Checks whether the given strings contains a substring inside it. Exit status is non-zero if the condition is not satisfied.
string_join separator [ string1 [ string2 ... [ stringN ] ] ]
Concatenates all given strings into a single one using the specified separator.
string_lstrip
Removes blank characters from the start of lines of the given text. Works like a filter, using both standard input and output.
string_rstrip
Removes blank characters from the end of lines of the given text. Works like a filter, using both standard input and output.
string_strip
Removes blank characters both from the end and the start of lines given. Works like a filter, using both standard input and output.