I have an attributes array as follows,
attributes = ["test, 2011", "photo", "198.1 x 198.1 cm", "Photo: Manu PK Full Screen"]
When i do this,
artist = attributes[-1].gsub("Photo:")
p artist
i get the following output in terminal
#<Enumerator: "Photo: Manu PK Full Screen":gsub("Photo:")>
Wondering why am I getting an enumerator object as output? Thanks in advance.
EDIT:
Please note that instead of attributes[-1].gsub("Photo:", ""), I am doing attributes[-1].gsub("Photo:")
So would like to know why enumerator object has returned here( I was expecting an error message) and what is going on.?
Ruby - 1.9.2
Rails - 3.0.7
#delete
it will delete every character in the given string, not the word. e.g."Photo of an otter".delete("Photo:") # => " f a er"
– Hinterland