Simplest way to replace a classname on set of elements?

Simplest way to replace a classname on set of elements?

Looking through the API, I can't see a "replaceClass()" method, but I want to do this:

$("div.class-to-replace").removeClass("class-to-replace").addClass("class-to-replace-it-with")

Is there a single method to do the above, or a better way?
Or is that indeed the most common way it's done?