Go to main content
The CHANGEBYTES function changes one or more occurrences of a specified string in a text expression to another string.
CHANGEBYTES(text-expression oldtext newtext [number])
TEXT expression in which bytes are to be changed. When text-expression is a multiline
TEXT expression, CHANGEBYTES preserves the line breaks in the returned value.
TEXT expression that contains one or more bytes that will be changed.
TEXT expression that contains one or more bytes that will replace oldtext.
INTEGER that represents the number of times oldtext should be replaced with newtext when oldtext appears more than once in text-expression. The default is to change all occurrences of oldtext.
Example 7-39 Changing Text Values Using Bytes
This example shows how to change one instance of a portion of a text value.
SHOW CHANGEBYTES('Hello there, Joe\nHello there, Jane',
'there', - 'to you', 1)
produces the following output.
Hello to you, Joe
Hello there, Jane