Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/split_with_character.rb

Instance Method Summary collapse

Instance Method Details

#split_with_character(breaker) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/split_with_character.rb', line 4

def split_with_character(breaker)
	string = self.split(breaker)
	l = []
	string.each do |s|
		y = "#{s}#{breaker}"
		l[l.length] = y
	end
	return l
end