Ruby - Strings - Indexing

  • + 0 comments
    string.tap { |s| s[4, 11] = ((s[4, 5].to_f + s[10, 5].to_f) / 2).round(2).to_s }