Skip to content

Commit

Permalink
docs: string.[lr]strip
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Jun 20, 2018
1 parent 633db28 commit 79d5892
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions docs/include-cmd-scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,34 @@ String Functions
:end-before: # END


string.strip
string.lstrip
string.rstrip

.. rubric:: *rTorrent-PS 1.1+ only*

.. code-block:: ini
string.strip = «text»[, «strippable»[, …]] ≫ string
string.lstrip = «text»[, «head»[, …]] ≫ string
string.rstrip = «text»[, «tail»[, …]] ≫ string
Strips a string on both sides, or its left / right side only.

If no additional arguments are passed, whitespace is removed (as defined by `C++` ``std::isspace``).

Additional arguments define segments that can be removed on the side(s) handled by the specific command.
Their order is of no importance, segments are removed until none of them fits anymore,
or the final result is empty.

.. rubric:: Examples

.. literalinclude:: rtorrent-ps/tests/commands/string.txt
:language: console
:start-at: # string.strip
:end-before: # END


string.map
string.replace

Expand Down
2 changes: 1 addition & 1 deletion docs/rtorrent-ps

0 comments on commit 79d5892

Please sign in to comment.