3/16/2023 0 Comments Visual studio for mac capitalizeIt simply iterates through an array ,passes each element to a block and creates a brand-new-array accumulating all the values returned from the block. Map method is also an instance method available with Array. => įind_index instance method of Array returns the first index of the given parameter depending on the presence of it within the array. Strings in Ruby have an instance method namely split that splits the given String and returns an array of substrings based on the separator given as an argument to it.Ģ.1.5 :001 > "this-is-a-ruby-string".split("-")Ģ.1.5 :002 > "another/example".split("/")Ģ.1.5 :003 > "second example for rubyists".split(" ")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |