| 344 | Return the length of a string or a (unexpanded) variable:: |
| 345 | |
| 346 | $(length string) |
| 347 | $(length-var var) |
| 348 | |
| 349 | Find the position of ``needle`` in ``haystack``, returns 0 if not found. |
| 350 | Negative ``start`` indices are relative to the end of ``haystack``, while |
| 351 | positive ones are one based:: |
| 352 | |
| 353 | $(pos needle, haystack[, start]) |
| 354 | $(lastpos needle, haystack[, start]) |
| 355 | |
| 356 | Returns the specified substring. The ``start`` works like with ``$(pos )``. |
| 357 | If the substring is partially outside the ``string`` the result will be |
| 358 | padded with ``pad`` if present:: |
| 359 | |
| 360 | $(substr string, start[, length[, pad]]) |
| 361 | |
| 362 | Insert ``in`` into ``str`` at the specified position. ``n`` works like with |
| 363 | ``$(pos )``, except that ``0`` is the end of the string:: |
| 364 | |
| 365 | $(insert in, str[, n[, length[, pad]]]) |
| 366 | |
| 367 | Translate ``string`` exchanging characters in ``from-set`` with ``to-set``, |
| 368 | optionally completing ``to-set`` with ``pad-char`` if specified. If no |
| 369 | ``pad-char`` characters absent in ``to-set`` will be deleted:: |
| 370 | |
| 371 | $(translate string, from-set[, to-set[, pad-char]]) |
| 372 | |
533 | | $(foreach var,words,text) |
| 567 | $(foreach var,words,body) |
| 568 | |
| 569 | C-style for-loop. Start by evaluating ``init``. Each iteration will |
| 570 | first check whether the ``condition`` (``kmk``-expression) is true, |
| 571 | then expand ``body`` concatenating the result to the previous iterations |
| 572 | (spaced), and finally evaluate ``next``:: |
| 573 | |
| 574 | $(for init,conditions,next,body) |
| 575 | |
| 576 | C-style while-loop. Each iteration will check whether the ``condition`` |
| 577 | (``kmk``-expression) is true, then expand ``body`` concatenating the |
| 578 | result to the previous iterations:: |
| 579 | |
| 580 | $(while conditions,body) |
715 | 777 | :Copyright: Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, |
716 | 778 | 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, |