以下代码中的含义[0]和[1..-1]含义是什么?
[0]
[1..-1]
def capitalize(string) puts "#{string[0].upcase}#{string[1..-1]}" end
ruby
ruby ×1