User Tools

Site Tools


syntax:functions:keepbetween

Differences

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

Link to this comparison view

Next revision
Previous revision
syntax:functions:keepbetween [2016/06/08 00:13] – created dmitrysyntax:functions:keepbetween [2021/08/14 22:11] (current) – [Examples] craigt
Line 1: Line 1:
-====== KeepBetween(text, stringAstringB) ======+====== KeepBetween(text, keep_startkeep_end) ====== 
 +Category:  Text function
  
-Returns characters between the first occurrence of //stringA// and the first occurence of //stringB// in //text//. Parameters //stringA// and //stringB// must not be empty. +\\  
-This function is case-sensitive+=====Description===== 
 +This function returns the characters between the first occurrence of //keep_start// and the first occurrence of //keep_end// in //text//.
  
- Example   Result  +\\  
-| keepbetween( %%'http://easymorph.com'%%%%'http://'%%, '.com'  | easymorph  | +=====Arguments===== 
-keepbetween('192.168.0.1 "GET /download.html HTTP/1.1"','/', ' ' download.html  |+^Argument^Type^Description
 +|text|Text|The text value to search within for the //after_string// string.| 
 +|keep_start|Text (must //not// be empty)|The text string to search for within //text// defining the starting point of the string to be returned\\ (not including this string).| 
 +|keep_end|Text (must //not// be empty)|The text string to search for within //text// defining the end point of the string to be returned\\ (not including this string).| 
 + 
 +**Return value type:** Text 
 + 
 +\\  
 +=====Remarks===== 
 +This function is case sensitive. 
 + 
 +//text//, //keep_start//, and //keep_end// are implicitly converted to text values if required. 
 + 
 +If //keep_start// is not found within //text//, all text from the start of //text// to //keep_end//.\\ 
 +If //keep_end// is not found within //text//, all text from the //keep_start// to the end of //text// is returned.\\ 
 +If neither //keep_start// nor //keep_end// are found within //text//, an (empty) value is returned. 
 + 
 + 
 +\\  
 +=====Examples===== 
 +  keepbetween('http://easymorph.com', 'http://', '.com'//Returns 'easymorph' 
 + 
 +  keepbetween('192.168.0.1 "GET /download.html HTTP/1.1"', '/', ' '//Returns download.html 
 + 
 +  keepbetween('Mary Joe Smith', 'Mary ', ' Smith') //Returns 'Joe' 
 + 
 +  keepbetween('Mary Joe Smith', 'Mark ', ' Smith') //Returns 'Mary Joe'  ('Mark' not found) 
 + 
 +  keepbetween('Mary Joe Smith', 'Mary ', ' Jones') //Returns 'Joe Smith'  ('Jones' not found) 
 + 
 +  keepbetween('Mary Joe Smith', 'Mark ', ' Jones') //Returns (empty)  (Neither 'Mark' nor 'Jones' are found) 
 +  
 + 
 +\\  
 +===== See also ===== 
 +  * [[syntax:functions:keepafter|KeepAfter(text, after_string)]] 
 +  * [[syntax:functions:keepbefore|KeepBefore(text, before_string)]] 
 +  * [[syntax:functions:keepchars|KeepChars(text, keep_string)]]
  
-=== See also === 
-  * [[syntax:functions:keepafter]] 
-  * [[syntax:functions:keepbefore]] 
syntax/functions/keepbetween.1465359238.txt.gz · Last modified: 2016/06/08 00:13 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki