Split self using pattern as separator.

assert "hello world".split('o')          ==  ["hell", " w", "rld"]

Property definitions

core :: string_search $ Text :: split
	# Split `self` using `pattern` as separator.
	#
	#     assert "hello world".split('o')          ==  ["hell", " w", "rld"]
	fun split(pattern: Pattern): Array[String]
	do
		var matches = pattern.split_in(self)
		var res = new Array[String].with_capacity(matches.length)
		for m in matches do res.add(m.to_s)
		return res
	end
lib/core/text/string_search.nit:442,2--451,4