I have a string that looks like this s55d5bef032706_parameters_0_parameter
and I want to replace the last _parameter
with _value
How would I go about this?
Currently I have the line below which unfortunately replaces all occurrences with value
new_id = id.split('_parameter').join('_value');
The question asked enter link description here is a sentence while mine is a single word therefore solutions are different, I just need to replace the occurrence of '_parameter' in my word