1獲取字串某部分
s = "My kingdom for a string!" s.slice(3,7) # kingdom s[3,7] # kingdom s[/.ing/] # king s[/str.*/] # string
s.slice(3).ord # 107
1獲取字串某部分
s = "My kingdom for a string!" s.slice(3,7) # kingdom s[3,7] # kingdom s[/.ing/] # king s[/str.*/] # string
s.slice(3).ord # 107