Possibility to make changes to submitted data before saved to database

I’d like to have the possibility to change user submitted data before it’s saved to the database. For example. I want the user to submit its company name and use that for the post title. But in case the user has no company I want to use the title, first and last_name input of the user for the post title.
Would be cool if there could be implemented something that would allow us to do those or other operations before submit.