Understand How Binding Works in Complex Manner
binding is a private method of Kernel. The getBinding method is able to call binding within the current context and return the current value of str.
The eval method may take an optional ‘binding’ argument which, if provided, causes the evaluation to be done within a specific scope or ‘context’.
Ruby provides the printf method to print ‘format strings’ containing specifiers starting with a percent sign, %.
You can treat a string as an array of characters and index into that array to find a character at a specific index using square brackets.
The Ruby String class provides a number of useful string handling methods. Most of these methods create new string objects.