I need to update some fields in an object from apex. The number of fields is not constant i.e. in some instances there might be 3 fields to be updated in some cases there could be 10.
I have these field names in a list of Strings that is generated dynamically.
Is there a way we could say
contact.lstfieldname = 'update value';
The above wouldn't work, is there a way we would mimic it?