this is my string.
var id = "timesheet_entries_attributes_0_entry_overtimes_attributes_0_code_id"
question is I want to replace the last zero with another number.
the zero's position is always change. But there are only two zeros in the string. And they can't be together.
such as :
var num = "2"; ("timesheet_entries_attributes_0_entry_overtimes_attributes_0_code_id").replace(/\d/,num);
but it always replace the first zero.
SoS!