You are viewing a single comment's thread. Return to all comments →
string.tap { |s| s[4, 11] = ((s[4, 5].to_f + s[10, 5].to_f) / 2).round(2).to_s }
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Strings - Indexing
You are viewing a single comment's thread. Return to all comments →