String Insert in Ruby for JS

Asked

Viewed 43 times

0

how can I make the code below in Ruby for JS.

(3...value_size).step(3) { |num|
   value.insert(value_size - num, separator)
}

To step I think of that loop for (var i = 3; i < value_size; i += 3), but for the method .insert? What are your ideas?

  • Please translate your question into English.

  • This Question is off-topic because it’s not Written in English. It may be reopened if Translated.

  • Sorry, updated!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.