def replace_array_item(data, old_item, new_item)
      data.map! {|item| (item == old_item) ? new_item : item}
    end
def replace_array_item(data, old_item, new_item)
      data.map! {|item| (item == old_item) ? new_item : item}
    end
def replace_array_item ( data , old_item , new_item ) data . map! { | item | ( item == old_item ) ? new_item : item } end
Replaces an item in an array with a different one into the same position.
Replaces an item in an array with a different one into the same position .