Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/src-generic/extended/String.rb

Instance Method Summary collapse

Instance Method Details

#charAt(index) ⇒ Object

[View source]

36
37
38
# File 'lib/src-generic/extended/String.rb', line 36

def charAt(index)
	return self[index]
end

#indexOf(substring, offset = 0) ⇒ Object

[View source]

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

#lastIndexOf(string) ⇒ Object

[View source]

20
21
22
23
24
25
26
# File 'lib/src-generic/extended/String.rb', line 20

def lastIndexOf(string)
	if (self.rindex(string).nil?)
		return 0
	else
		return self.rindex(string)
	end
end

#startsWith(string) ⇒ Object

[View source]

28
29
30
# File 'lib/src-generic/extended/String.rb', line 28

def startsWith(string)
	return self.start_with?(string)
end

#toUpperCaseObject

[View source]

32
33
34
# File 'lib/src-generic/extended/String.rb', line 32

def toUpperCase()
	return self.upcase
end

#trimObject

[View source]

16
17
18
# File 'lib/src-generic/extended/String.rb', line 16

def trim()
	return self.strip()
end