Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/src-generic/extended/String.rb
Instance Method Summary collapse
- #charAt(index) ⇒ Object
- #indexOf(substring, offset = 0) ⇒ Object
- #lastIndexOf(string) ⇒ Object
- #startsWith(string) ⇒ Object
- #toUpperCase ⇒ Object
- #trim ⇒ Object
Instance Method Details
permalink #charAt(index) ⇒ Object
[View source]
36 37 38 |
# File 'lib/src-generic/extended/String.rb', line 36 def charAt(index) return self[index] end |
permalink #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 |
permalink #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 |
permalink #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 |
permalink #toUpperCase ⇒ Object
[View source]
32 33 34 |
# File 'lib/src-generic/extended/String.rb', line 32 def toUpperCase() return self.upcase end |
permalink #trim ⇒ Object
[View source]
16 17 18 |
# File 'lib/src-generic/extended/String.rb', line 16 def trim() return self.strip() end |