1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Document that StringScanner#matched_size returns size in bytes [ci skip]

Fixes [Bug #17139]
This commit is contained in:
Jeremy Evans 2020-09-02 10:40:17 -07:00
parent 0938bad0a5
commit d9b8411a7b

View file

@ -1089,8 +1089,9 @@ strscan_matched(VALUE self)
}
/*
* Returns the size of the most recent match (see #matched), or +nil+ if there
* was no recent match.
* Returns the size of the most recent match in bytes, or +nil+ if there
* was no recent match. This is different than <tt>matched.size</tt>,
* which will return the size in characters.
*
* s = StringScanner.new('test string')
* s.check /\w+/ # -> "test"