DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR RUBY
ruby array replace element
p array.map { |x| x == 4 ? 'Z' : x } # => [1, 2, 3, 'Z']
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#ruby
#array
#replace
#element
ADD COMMENT
Topic
COMMENT
Name
3+8 =
Submit