User Tools

Site Tools


syntax:functions:mid

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
syntax:functions:mid [2015/05/26 09:23] dmitrysyntax:functions:mid [2021/08/16 00:02] (current) craigt
Line 1: Line 1:
-===== Mid(text, NK) =====+======Mid(text, startlength) =====
 +Category:  Text function
  
-Returns //K// characters of the //text//, starting with the //N//-th character, where //N// and //K// are numbers.+\\  
 +=====Description===== 
 +This function returns a substring of text from //text////length// characters longand starting with the character in position //start//.
  
-First argument is implicitly converted into text, if required.+\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|text|Text|Any text value from which the substring of text is returned.| 
 +|start|Number (Integer)|The position of the first character within //text// to be returned.| 
 +|length|Number (Integer)|The number of characters to return.|
  
-^  Example  ^  Result  ^ +**Return value type:** Text 
- mid('27.03.2015', 4, 2)   |  03  | + 
- mid('Los Angeles', 5, 5)  |  Angel  |+\\  
 +=====Remarks===== 
 +Number values entered for //text// are implicitly converted to text. 
 + 
 +Entering a value for //start// that is past the number of characters in //text// returns and empty value. 
 + 
 +Entering a value for //length// that exceeds the number of characters after the //start// position, returns the text up to the end of //text//.  
 + 
 +\\  
 +=====Examples===== 
 +  mid('27.03.2015', 4, 2) //Returns '03
 + 
 +  mid('Los Angeles', 5, 5) //Returns 'Angel' 
 + 
 +  mid('Mary', 3, 5) //Returns 'ry'  (Returns characters to the end of the text.) 
 + 
 +  mid(123456, 4, 3) //Returns '456' (Number implicitly converted; return value is a string.) 
 + 
 +  mid('Mary', 5, 3) //Returns an empty value (The starting point is past the end of the text.) 
 + 
 +\\  
 +=====See also===== 
 +  * [[syntax:functions:left|Left(text, no_of_chars)]] 
 +  * [[syntax:functions:remove|Remove(text, start, length)]] 
 +  * [[syntax:functions:right|Right(text, no_of_chars)]]
  
-**See also** 
-  * [[syntax:functions:left]] 
-  * [[syntax:functions:right]] 
-  * [[syntax:functions:remove]] 
syntax/functions/mid.1432646607.txt.gz · Last modified: 2015/05/26 09:23 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki