mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
Update doc/filters/split.rst
Added missing quotes in return values.
This commit is contained in:
@@ -25,7 +25,7 @@ You can also pass a ``limit`` argument:
|
|||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
|
|
||||||
{{ "one,two,three,four,five"|split(',', 3) }}
|
{{ "one,two,three,four,five"|split(',', 3) }}
|
||||||
{# returns [one, two, "three,four,five"] #}
|
{# returns ['one', 'two', 'three,four,five'] #}
|
||||||
|
|
||||||
If the ``delimiter`` is an empty string, then value will be split by equal
|
If the ``delimiter`` is an empty string, then value will be split by equal
|
||||||
chunks. Length is set by the ``limit`` argument (one character by default).
|
chunks. Length is set by the ``limit`` argument (one character by default).
|
||||||
@@ -33,10 +33,10 @@ chunks. Length is set by the ``limit`` argument (one character by default).
|
|||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
|
|
||||||
{{ "123"|split('') }}
|
{{ "123"|split('') }}
|
||||||
{# returns [1, 2, 3] #}
|
{# returns ['1', '2', '3'] #}
|
||||||
|
|
||||||
{{ "aabbcc"|split('', 2) }}
|
{{ "aabbcc"|split('', 2) }}
|
||||||
{# returns [aa, bb, cc] #}
|
{# returns ['aa', 'bb', 'cc'] #}
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user