Difference between revisions of "SUBSTR()"

From Lianjapedia
Jump to: navigation, search
m (Text replace - "Recital" to "Lianja")
(See Also)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to perform substring extraction
 
Function to perform substring extraction
 
  
 
==Syntax==
 
==Syntax==
 
SUBSTR(<expC> | <memofield>, <expN1> [,<expN2>])
 
SUBSTR(<expC> | <memofield>, <expN1> [,<expN2>])
 
  
 
==See Also==
 
==See Also==
[[AT()]], [[ATNEXT()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[SET STRESCAPE]], [[STR()]], [[STREXTRACT()]], [[STRSTR()]], [[STRTRAN()]], [[STUFF()]]
+
[[AT()]], [[AT_C()]], [[ATNEXT()]], [[CHRTRAN()]], [[CHRTRANC()]], [[CONCAT()]], [[INLIST()]], [[LEFT()]], [[LEFTC()]], [[LEN()]], [[LENC()]], [[MID()]], [[OCCURS()]], [[RAT()]], [[RAT_C()]], [[RIGHT()]], [[RIGHTC()]], [[SET EXACT]], [[SET STRCOMPARE]], [[SET STRESCAPE]], [[STR()]], [[STR_COMPRESS()]], [[STR_UNCOMPRESS()]], [[STREXTRACT()]], [[STRLEN()]], [[STRSTR()]], [[STRTRAN()]], [[STUFF()]], [[STUFFC()]], [[SUBSTRC()]], [[UCASE()]], [[UPPER()]]
 
+
  
 
==Description==
 
==Description==
 
The SUBSTR() 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 SUBSTR() 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.
 
  
 
==Example==
 
==Example==
Line 22: Line 18:
 
</code>
 
</code>
  
 
==Products==
 
Lianja Server, Lianja
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:String Data]]
 
 
[[Category:String Data Functions]]
 
[[Category:String Data Functions]]

Latest revision as of 12:44, 22 March 2021

Purpose

Function to perform substring extraction

Syntax

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

See Also

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

Description

The SUBSTR() 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.

Example

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