Method: String#indexOf

Defined in:
lib/src-generic/extended/String.rb

#indexOf(substring, offset = 0) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/src-generic/extended/String.rb', line 2

def indexOf(substring, offset=0)
	if (offset == 0)
		index = index(substring)
	else
		index = index(substring, offset)
	end

	if (index.nil?)
		return -1
	else
		return index
	end
end