What does %x!ls! represents?
Same as back tick command output ls
Same as 'x'
Same as "xls"
None of the mentioned
Answer and explanation
It is same as back tick command output ls.
ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
7 practice sets · Page 1 of 1
What does %x!ls! represents?
Same as back tick command output ls
Same as 'x'
Same as "xls"
None of the mentioned
It is same as back tick command output ls.
What does %Q{ Learn ruby language } represents?
" Learn Ruby language "
"%{ Learn Ruby language }"
"%Q{ Learn Ruby language }"
None of the mentioned
Anything inside %Q{} is written inside "".
What does %{Learn ruby language} represents?
"Learn Ruby language"
"%{Learn Ruby language}"
" Learn Ruby language "
None of the mentioned
Anything written inside %{} is same as anything written inside "".
What do we mean by expression substitution?
Embedding the value of Ruby expression into a string using #{ }
Substituting string functions
Storing string value
None of the mentioned
Strings are displayed #{} sequence.
What is the role of ! at the end of the capitalize method?
It is the syntax for using capitalize method
It modifies the value stored in the variable
It indicates the termination of string
None of the mentioned
It is used for modifying the variable.
What is the use of .capitalize method?
It capitalizes the entire string
It capitalize on the first letter of the string
It capitalize the strings which are in small case
All of the mentioned
It capitalizes only the first letter.
The .upcase and .capitalize method are used for capitalizing the whole string.
True
False
The .capitalize method doesn't change the whole string to uppercase, it just capitalizes the first letter.