I don't know a way to delete and replace, but I can offer a workaround.
Select and delete all content on the master page you want to replace. (C)
Hold the click on the master you want to use (A), and drag it onto the one you want to replace. (Let go when you see a solid black box on the pages icon)
The will turn C into a master page based on (and identical to) A.
The net result is that any changes you make on master A will be reflected on master C
Thank you SRiegel, I will check your idea!
I use another,( maybe faster way) in long documents.
1 Do not remove C, Right Click on Mater Option for C-Maser and Based on A-Master.
2. Cmd-J C, cmd-A, Backspace. (remove on items on C).
You could apply the A master to the pages before deleting the C master. That's not one step, but it accomplishes what you want.
It can be scripted—this is AppleScript. :
set myfind to "C-Master"
set myreplace to "A-Master"
tell application "Adobe InDesign CC 2014"
tell active document
set m to item 1 of every master spread whose name is myfind
set r to item 1 of every master spread whose name is myreplace
set p to every page whose applied master is m
repeat with x in p
set applied master of x to r
Thank you very much for your scrpit.