Extract string from parameters in a more flexible way.