Renaming a model view

Hello. I would like to rename a model view. I have a list of the old names and a list of new names.

Is it possible to do this with some kind of a function. Some thing like

function ranmeView(OldName, NewName)

Any help would be appreciated.

Thank you