Chapter 0-4 Flashcards
In Ruby what is an object?
Literally everything integers characters, text arrays-everything.
what does the method .even? do??
Returns true and false in which the method determines whether the number or variable is even or odd.
What does the .next method do?
It increases the number or variable by plus one.
What do you do if you want to see the all the methods available to the data type?
After the data type put .methods, to see all the available methods.
What does the .index method do?
This method finds the position of the argument in the array and returns that data in the array.
What does the method .between? do??
It is a method to determine if the number lies between two numbers Ex. 2.between? 1,3 Returns true.
What does the .length method do?
It returns the number of characters in a string including spaces.
What is string interpolation?
It is a placeholder that replaces placeholders with values they represent.
What does the method .include? do??
It sorts for a certain number of characters within a string
What does the .start_with? do??
It check to see if a string starts with a certain set of characters.
What does the .end_with? method do??
It checks to see if a string end with a certain set of characters.
What does the .index() method do??
It find a certain set of characters and returns the index of the character or characters.
What does the methods .uppercase and .downcase do?
.uppercase makes the whole string captial letters and downcase puts all the lets to the standard form.
What does the .swapcase method do?
Swap every character in the string to lower case to upper case and vice versa.
What does the method .split do?
Returns an array for a string generally separated by a space(‘’)