我对来自 RubyMonk 的以下问题的回答有点困惑.
Let's find the second character in the string 'RubyMonk Is Pretty Brilliant' preceded by a space, which should be 'P'
'RubyMonk Is Pretty Brilliant'.match(/ ./, 9)
为什么我要在参数中放置一个“9”?
非常感谢您的解释。
最佳答案
和尚清楚地说
When the second parameter is present, it specifies the position in the string to begin the search.
关于RubyMonk 高级字符串操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29684857/