Skip to content

Commit

Permalink
doc/stdlib: add {,l,r}strip, {upp,low}ercase, {begin,end}s_with
Browse files Browse the repository at this point in the history
  • Loading branch information
nolta committed Jun 2, 2012
1 parent b6d9cd5 commit c4c47af
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
42 changes: 42 additions & 0 deletions doc/helpdb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,48 @@ collection[key...] = value
"),

(E"Strings",E"strip",E"strip(string)
Return 'string' with any leading and trailing whitespace removed.
"),

(E"Strings",E"lstrip",E"lstrip(string)
Return 'string' with any leading whitespace removed.
"),

(E"Strings",E"rstrip",E"rstrip(string)
Return 'string' with any trailing whitespace removed.
"),

(E"Strings",E"begins_with",E"begins_with(string, prefix)
Returns 'true' if 'string' starts with 'prefix'.
"),

(E"Strings",E"ends_with",E"ends_with(string, suffix)
Returns 'true' if 'string' ends with 'suffix'.
"),

(E"Strings",E"uppercase",E"uppercase(string)
Returns 'string' with all characters converted to uppercase.
"),

(E"Strings",E"lowercase",E"lowercase(string)
Returns 'string' with all characters converted to lowercase.
"),

(E"Strings",E"join",E"join(strings, delim)
Join an array of strings into a single string, inserting the given
Expand Down
28 changes: 28 additions & 0 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,34 @@ Strings

Return an array of strings by splitting the given string on occurrences of the given character delimiter. The second argument may also be a set of character delimiters to use. The third argument specifies whether empty fields should be included.

.. function:: strip(string)

Return ``string`` with any leading and trailing whitespace removed.

.. function:: lstrip(string)

Return ``string`` with any leading whitespace removed.

.. function:: rstrip(string)

Return ``string`` with any trailing whitespace removed.

.. function:: begins_with(string, prefix)

Returns ``true`` if ``string`` starts with ``prefix``.

.. function:: ends_with(string, suffix)

Returns ``true`` if ``string`` ends with ``suffix``.

.. function:: uppercase(string)

Returns ``string`` with all characters converted to uppercase.

.. function:: lowercase(string)

Returns ``string`` with all characters converted to lowercase.

.. function:: join(strings, delim)

Join an array of strings into a single string, inserting the given delimiter between adjacent strings.
Expand Down

0 comments on commit c4c47af

Please sign in to comment.