If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Append array indexes in ruby?
3 posts
• Page 1 of 1
Append array indexes in ruby?
Hi,
Is there any way to append array indexes in ruby?
My arrays:
array 1:
red
green
white
array 2:
tomato
frog
snow
I would like to get at the output :
red tomato
green frog
white snow
I guess the comma between the indexes in the final result should be also defined in the ruby code, so would be nice if we could add a 3th input in to this ruby code which would define the comma.
For instance, if the string comma input would be "@", the final result would be then:
red@tomato
green@frog
white@snow
People, it would be even nicer if you post your answer as a code as well. Take into account that most of us are not reasonable coders
Thanks!
Is there any way to append array indexes in ruby?
My arrays:
array 1:
red
green
white
array 2:
tomato
frog
snow
I would like to get at the output :
red tomato
green frog
white snow
I guess the comma between the indexes in the final result should be also defined in the ruby code, so would be nice if we could add a 3th input in to this ruby code which would define the comma.
For instance, if the string comma input would be "@", the final result would be then:
red@tomato
green@frog
white@snow
People, it would be even nicer if you post your answer as a code as well. Take into account that most of us are not reasonable coders
Thanks!
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Append array indexes in ruby?
Thanks KG!
One liners are the best
One liners are the best
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 78 guests