Sha256: 3dacd4aeabd00c548ac12a5bca22bdb5350af64c46e9399396364b148c679f49
Contents?: true
Size: 338 Bytes
Versions: 18
Compression:
Stored size: 338 Bytes
Contents
module Aio::Base::Toolkit::Array class << self # 按pattern分割数组 def split(array, pattern) res = [[]] count = 0 array.each do |a| a = Aio::Base::Toolkit::String.safe(a) unless pattern.match(a) res[count] << a else res << [] count += 1 end end res end end end
Version data entries
18 entries across 18 versions & 1 rubygems