Difference between revisions of "CHRTRAN()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 4: Line 4:
  
 
==Syntax==
 
==Syntax==
CHRTRAN(<expC1> | <memofield>, [<expC2>, <expC3>, [<expN1> [,<expN2>]]])
+
CHRTRAN(<expC1> | <memofield>, <expC2> [, <expC3> [, <expN1> [, <expN2>]]])
  
  
 
==See Also==
 
==See Also==
[[AT()]], [[ATNEXT()]], [[MTOS()]], [[RAT()]], [[STR()]], [[STREXTRACT()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]], [[SUBSTR()]], [[TRIM()]]
+
[[AT()]], [[ATNEXT()]], [[MTOS()]], [[RAT()]], [[SET STRESCAPE]], [[STR()]], [[STREXTRACT()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]], [[SUBSTR()]], [[TRIM()]]
  
  
 
==Description==
 
==Description==
The CHRTRAN() 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 CHRTRAN() function returns a character expression that contains the result of the string translation.
+
The CHRTRAN() 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 CHRTRAN() function returns a character expression that contains the result of the string translation.
  
 
The CHRTRAN() function is synonymous with the STRTRAN() function.
 
The CHRTRAN() function is synonymous with the STRTRAN() function.

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

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


See Also

AT(), ATNEXT(), MTOS(), RAT(), SET STRESCAPE, STR(), STREXTRACT(), STRTRAN(), STRZERO(), STUFF(), SUBSTR(), TRIM()


Description

The CHRTRAN() 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 CHRTRAN() function returns a character expression that contains the result of the string translation.

The CHRTRAN() function is synonymous with the STRTRAN() function.


Example

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


Products

Recital Server, Recital