-2
'Open Source man Is Pretty Brilliant'.match(/ ./)

'Open source man Is Pretty Brilliant'.match(/ ./, 9)

我正在关注这个:http ://rubymonk.com/learning/books/1-ruby-primer/chapters/5-strings/lessons/8-string-advanced

有人可以解释一下吗,我无法理解。

谢谢你。

4

1 回答 1

1

和尚清楚地说

When the second parameter is present, it specifies the position 
in the string to begin the search.

大师说:

"I'm not pleased with your question at all. Its unclear and there is no proof of effort"

更新

'Open Source man Is Pretty Brilliant'.match(/ ./) #=> only one parameter
'Open Source man Is Pretty Brilliant'.match(/ ./, 9) #=> 9 is the second parameter.

大师说:

"There's nothing equal to paying attention to what you read and what you practice. 
Outside this there is no Ruby, there is no Java"
于 2013-11-03T08:25:14.330 回答