Difference between revisions of "MID()"

From Lianjapedia
Jump to: navigation, search
(Created page with "==Purpose== Function to perform substring extraction ==Syntax== MID(<expC> | <memofield>, <expN1> [,<expN2>]) ==See Also== AT(), AT_C(), ATNEXT(), CHRTRAN(),...")
 
Line 9: Line 9:
  
 
==Description==
 
==Description==
The MID() function extracts a substring from <expC> or <memofield> starting at position <expN1> of width <expN2>.  If <expN1> is negative, the extraction starts from the right side of the string.  If <expN2> is omitted, a substring will be extracted up to the end of <expC>.  When used in conjunction with the AT() function, the SUBSTR() function is very useful for extracting selected information from character strings.
+
The MID() function extracts a substring from <expC> or <memofield> starting at position <expN1> of width <expN2>.  If <expN1> is negative, the extraction starts from the right side of the string.  If <expN2> is omitted, a substring will be extracted up to the end of <expC>.  When used in conjunction with the AT() function, the MID() function is very useful for extracting selected information from character strings.
  
Introduced in Lianja 2.1.0.
+
Synonym of [[SUBSTR()]].
  
 
==Example==
 
==Example==
Line 23: Line 23:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:String Data Functions]]
 
[[Category:String Data Functions]]
 +
[[Category:Lianja v2.1]]

Revision as of 10:02, 14 June 2016

Purpose

Function to perform substring extraction

Syntax

MID(<expC> | <memofield>, <expN1> [,<expN2>])

See Also

AT(), AT_C(), ATNEXT(), CHRTRAN(), CHRTRANC(), CONCAT(), INLIST(), LEFT(), LEFTC(), LEN(), LENC(), OCCURS(), RAT(), RAT_C(), RIGHT(), RIGHTC(), SET EXACT, SET STRCOMPARE, SET STRESCAPE, STR(), STREXTRACT(), STRLEN(), STRSTR(), STRTRAN(), STUFF(), STUFFC(), SUBSTR(), SUBSTRC(), UCASE(), UPPER()

Description

The MID() function extracts a substring from <expC> or <memofield> starting at position <expN1> of width <expN2>. If <expN1> is negative, the extraction starts from the right side of the string. If <expN2> is omitted, a substring will be extracted up to the end of <expC>. When used in conjunction with the AT() function, the MID() function is very useful for extracting selected information from character strings.

Synonym of SUBSTR().

Example

m_usrname = "GTW  , Gary T West  "
? mid(m->m_usrname,at(",",m->m_usrname)+1)
Gary T West