Please read this carefully as it is not what you might be expecting.
I'm building my site in a development sub domain. I don't want to have to go through the complications of running find and replace plugins after moving the site to the live area (as this can often go wrong on some serialized data).
This is not the direct answer to your need, but if you were going to switch subdomains, you should have created the links, images, etc. without the domain in them. You should have added a filter to remove the domain. Then you would have root absolute links beginning with '/' not 'http://www.domain.com/'.
Indeed this is not as I would expect. I am used to doing this statically. With that technique, aside from changing the DEFINEs in wp-config.php you'll have to search/replace the entries in the database. To do this, just take a MySQL dump and run the following script with something like script.sh dump.sql > new_dump.sql. Load newdump.sql into the DB and you should be good to go.