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 #
2022-12-30 07:48:10
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 #