OVERLAY

Read syntax diagramSkip visual syntax diagram
>>-OVERLAY(new,target--+-----------------------------------+---->
                       '-,-+---+-+-----------------------+-'   
                           '-n-' '-,-+--------+-+------+-'     
                                     '-length-' '-,pad-'       

>--)-----------------------------------------------------------><

returns the string target, which, starting at the nth character, is overlaid with the string new, padded or truncated to length length. (The overlay may extend beyond the end of the original target string.) If you specify length, it must be a positive whole number or zero. The default value for length is the length of new. If n is greater than the length of the target string, padding is added before the new string. The default pad character is a blank, and the default value for n is 1. If you specify n, it must be a positive whole number.

Here are some examples:
OVERLAY(' ','abcdef',3)         ->    'ab def'
OVERLAY('.','abcdef',3,2)       ->    'ab. ef'
OVERLAY('qq','abcd')            ->    'qqcd'
OVERLAY('qq','abcd',4)          ->    'abcqq'
OVERLAY('123','abc',5,6,'+')    ->    'abc+123+++'