Skip to content

Commit

Permalink
docs for string.shorten
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Aug 7, 2018
1 parent dc686a9 commit be15e29
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions docs/include-cmd-scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,29 @@ String Functions
:end-before: # END


string.shorten

.. versionadded:: 1.2 **rTorrent-PS only**

.. code-block:: ini
string.shorten = «text»[, «maxlen»[, «tail»]] ≫ string
Returns a condensed version of a UTF-8 encoded string, no longer than *«maxlen»*,
by replacing a middle piece of it with ```` if necessary.
The length arguments can be passed as either strings (base 10) or values,
and they count Unicode characters.

*«tail»* determines the maximal length of the trailing part, with a default of 5.

.. rubric:: Examples

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


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

Expand Down

0 comments on commit be15e29

Please sign in to comment.