mardi 13 avril 2021

Ruby | How to convert mail like numbers?

I have an exercise where I have to make a program to program an email list from 1 to 50 in this format "jean.dupont.01@email.fr"

I have tried several methods, and I think I have found the right one, but it only converts the numbers. In the result obtained in the terminal I get the email address and the numbers in the array from 1 to 50. I would like this to display the mails 1 by 1 with the numbers changing, thank you in advance.

a = (1..50).to_a

puts "jean.dupont.#{a}@email.fr"

Aucun commentaire:

Enregistrer un commentaire