How Blocks Differ from Methods, more info?


I am new to this and was wondering if I could get more of an explanation as to what this means:

string[0] refers to the first character in the string; string[1..-1] refers to the range of the second through final characters. Therefore, the method prints out the capitalized version of the first character and prints the second through final characters as-is.

I understand what it does, but still don't understand why it works. Any insight would be appreciated.

Replace this line with your code.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.