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

Version Path
aio_elin-1.1.8 lib/aio/base/toolkit/array.rb
aio_elin-1.1.7 lib/aio/base/toolkit/array.rb
aio_elin-1.1.4 lib/aio/base/toolkit/array.rb
aio_elin-1.1.3 lib/aio/base/toolkit/array.rb
aio_elin-1.1.2 lib/aio/base/toolkit/array.rb
aio_elin-1.1.1 lib/aio/base/toolkit/array.rb
aio_elin-1.1.0 lib/aio/base/toolkit/array.rb
aio_elin-1.0.9 lib/aio/base/toolkit/array.rb
aio_elin-1.0.8 lib/aio/base/toolkit/array.rb
aio_elin-1.0.7 lib/aio/base/toolkit/array.rb
aio_elin-1.0.6 lib/aio/base/toolkit/array.rb
aio_elin-1.0.5 lib/aio/base/toolkit/array.rb
aio_elin-1.0.4 lib/aio/base/toolkit/array.rb
aio_elin-1.0.3 lib/aio/base/toolkit/array.rb
aio_elin-1.0.2 lib/aio/base/toolkit/array.rb
aio_elin-1.0.1 lib/aio/base/toolkit/array.rb
aio_elin-1.0.0 lib/aio/base/toolkit/array.rb
aio_elin-0.0.1 lib/aio/base/toolkit/array.rb