Actions
Feature #4414
closedAddition to String.split
Status:
Rejected
Assignee:
-
Target version:
-
Description
=begin
I'm wondering whether the following feature is acceptable before I work on a patch:
When String.split is given one or more integer arguments, the string is divided at those indices.
str = '1.9ruby30932'
version, language, revision = str.split(3, 7)
Thanks,
Loren
=end
Updated by naruse (Yui NARUSE) about 14 years ago
=begin
Your proposal seems valid, because current String#split only accept arguments whose first argument has to_str method.
The problem is the use case can be solbed by String#unpack (or lib/scanf.rb) like following.
version, language, revision = str.unpack('a3a4a*')
=end
Updated by shyouhei (Shyouhei Urabe) about 13 years ago
- Description updated (diff)
- Status changed from Open to Rejected
Please use unpack instead.
Actions
Like0
Like0Like0