Difference between revisions of "STRTRAN()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
String Data
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to search for and replace text within a character string or memo field
 
Function to search for and replace text within a character string or memo field
Line 8: Line 4:
  
 
==Syntax==
 
==Syntax==
STRTRAN(<expC1> | <memofield>, [<expC2>, <expC3>, [<expN1> [,<expN2>]]])
+
STRTRAN(<expC1> | <memofield>, <expC2> [, <expC3> [, <expN1> [, <expN2>]]])
  
  
 
==See Also==
 
==See Also==
[[AT()]], [[ATNEXT()]], [[CHRTRAN()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[STR()]], [[STREXTRACT()]], [[STUFF()]], [[SUBSTR()]]
+
[[AT()]], [[ATNEXT()]], [[CHRTRAN()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[SET STRESCAPE]], [[STR()]], [[STR_REPLACE()]], [[STREXTRACT()]], [[STUFF()]], [[SUBSTR()]]
  
  
 
==Description==
 
==Description==
The STRTRAN() function will search <expC1> or <memofield> and replace text within <expC1> or <memofield> with <expC3> wherever the occurrence of <expC2> is found.  The optional <expN1> specifies the start position for the search in <expC1>.  If this is not specified then the default is 1.  The optional <expN2> specifies the number of occurrences of <expC2> to replace with <expC3>.  If this is not specified, then all occurrences starting from <expN1> are replaced.  This function can be used to remove blank spaces in character strings.  The STRTRAN() function returns a character expression that contains the result of the string translation.
+
The STRTRAN() function will search <expC1> or <memofield> and replace text within <expC1> or <memofield> with <expC3> wherever the occurrence of <expC2> is found.  If <expC3> is not specified, instances of the text in <expC2> are removed.  The optional <expN1> specifies the start position for the search in <expC1>.  If this is not specified then the default is 1.  The optional <expN2> specifies the number of occurrences of <expC2> to replace with <expC3>.  If this is not specified, then all occurrences starting from <expN1> are replaced.  This function can be used to remove blank spaces in character strings.  The STRTRAN() function returns a character expression that contains the result of the string translation.
  
  
Line 27: Line 23:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:String Data]]
 
[[Category:String Data]]
 
[[Category:String Data Functions]]
 
[[Category:String Data Functions]]

Latest revision as of 10:01, 22 July 2010

Purpose

Function to search for and replace text within a character string or memo field


Syntax

STRTRAN(<expC1> | <memofield>, <expC2> [, <expC3> [, <expN1> [, <expN2>]]])


See Also

AT(), ATNEXT(), CHRTRAN(), INLIST(), LEFT(), OCCURS(), RAT(), RIGHT(), SET STRESCAPE, STR(), STR_REPLACE(), STREXTRACT(), STUFF(), SUBSTR()


Description

The STRTRAN() function will search <expC1> or <memofield> and replace text within <expC1> or <memofield> with <expC3> wherever the occurrence of <expC2> is found. If <expC3> is not specified, instances of the text in <expC2> are removed. The optional <expN1> specifies the start position for the search in <expC1>. If this is not specified then the default is 1. The optional <expN2> specifies the number of occurrences of <expC2> to replace with <expC3>. If this is not specified, then all occurrences starting from <expN1> are replaced. This function can be used to remove blank spaces in character strings. The STRTRAN() function returns a character expression that contains the result of the string translation.


Example

? strtran("Hello World", "ello", "i")
Hi World


Products

Recital Server, Recital