User Tools

Site Tools


syntax:functions:keepbefore

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
syntax:functions:keepbefore [2015/04/03 18:27] elenapsyntax:functions:keepbefore [2021/03/23 19:07] dmitry
Line 7: Line 7:
 |  KeepBefore( '5pm', 'pm' )  |  '5'  | |  KeepBefore( '5pm', 'pm' )  |  '5'  |
 |  keepbefore('October 2015','2015' |  'October '  | |  keepbefore('October 2015','2015' |  'October '  |
 +
 +The functions can have the optional third parameter with the index of the separator. The index can be negative - in this case, it's counted from the end of the text.
 +
 +^  Example  ^  Result  ^
 +|  KeepBefore( 'a/b/c/d', '/', 2)  |  'a/b'  |
 +|  keepbefore( 'a/b/c/d', '/', -1)  |  'a/b/c'  |
  
 === See also === === See also ===
   * [[syntax:functions:keepafter]]   * [[syntax:functions:keepafter]]
   * [[syntax:functions:removestart]]   * [[syntax:functions:removestart]]
syntax/functions/keepbefore.txt · Last modified: 2021/08/14 22:09 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki