mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-20 14:36:57 +00:00
Tweak previous commit
This commit is contained in:
+4
-4
@@ -643,8 +643,7 @@ Comparisons
|
||||
The following comparison operators are supported in any expression: ``==``,
|
||||
``!=``, ``<``, ``>``, ``>=``, and ``<=``.
|
||||
|
||||
You can also check if a string ``starts with`` or ``ends with`` another
|
||||
string:
|
||||
Check if a string ``starts with`` or ``ends with`` another string:
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
@@ -654,6 +653,9 @@ string:
|
||||
{% if 'Fabien' ends with 'n' %}
|
||||
{% endif %}
|
||||
|
||||
Check that a string contains another string via the containment operator (see
|
||||
next section).
|
||||
|
||||
.. note::
|
||||
|
||||
For complex string comparisons, the ``matches`` operator allows you to use
|
||||
@@ -664,8 +666,6 @@ string:
|
||||
{% if phone matches '/^[\\d\\.]+$/' %}
|
||||
{% endif %}
|
||||
|
||||
For simple string comparisons, the containment operator can be used.
|
||||
|
||||
Containment Operator
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user