This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
MID

MID 


 

MID ( value , startFrom {, numChars} ) 
Parameter Type   Description
value  Text, CellRef, Expression in Text containing the characters to extract
startFrom  Number in Number designating the first character to extract in text
numChars  Number in Number of characters to return

The MID function returns the requested number of characters from value starting at the position specified in startFrom. It accepts text data for value and numeric data for startFrom and numChars. It returns text data.

In value, pass the text string containing the characters you want to extract. It can be a string, a formula that returns a string, or a reference to a cell containing a string.

In startFrom, pass a number representing the first character you want to extract in text, with the first character in the text having a value of one (1); if not an integer, the number is truncated. It can be a string, a formula that returns a string, or a reference to a cell containing a string. If startFrom:

  • is greater than the length of value, an empty string (" ") is returned
  • is less than the length of value, but startFrom + numChars exceeds the length of value, the characters up to the end of text are returned.

In numChars, pass the number of characters to return from value; if an integer is not specified, the number is truncated.

Example  

MID(B17,5,8)

MID("hello world",7,20) //"world"

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Formulas

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)