Difference between revisions of "STR REPLACE()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 8: | Line 8: | ||
==Syntax== | ==Syntax== | ||
− | STR_REPLACE(<expC1 | + | STR_REPLACE(<expC1>, <expC2>, <expC3> | <memofield>, [<expN1>]) |
Line 16: | Line 16: | ||
==Description== | ==Description== | ||
− | The STR_REPLACE() function will search < | + | The STR_REPLACE() function will search <expC3> or <memofield> and replace text within <expC3> or <memofield> with <expC2> wherever the occurrence of <expC1> is found. The optional <expN1> can be used to return the nummber of replacements made. The STR_REPLACE() function returns a character expression that contains the result of the string replacement. |
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | ? str_replace("ello", "i","Hello World") | + | ? str_replace("ello", "i","Hello World",m_count) |
Hi World | Hi World | ||
+ | ? m_count | ||
+ | 1 | ||
</code> | </code> | ||
Revision as of 12:43, 13 October 2009
Class
String Data
Purpose
Function to search for and replace text within a character string or memo field
Syntax
STR_REPLACE(<expC1>, <expC2>, <expC3> | <memofield>, [<expN1>])
See Also
AT(), ATNEXT(), CHRTRAN(), INLIST(), LEFT(), OCCURS(), RAT(), RIGHT(), STR(), STREXTRACT(), STRTRAN(), STUFF(), SUBSTR()
Description
The STR_REPLACE() function will search <expC3> or <memofield> and replace text within <expC3> or <memofield> with <expC2> wherever the occurrence of <expC1> is found. The optional <expN1> can be used to return the nummber of replacements made. The STR_REPLACE() function returns a character expression that contains the result of the string replacement.
Example
? str_replace("ello", "i","Hello World",m_count) Hi World ? m_count 1
Products
Recital Server, Recital