mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 08:10:13 +01:00
11 lines
198 B
Ruby
11 lines
198 B
Ruby
class String
|
|
def starts_with?(other)
|
|
head = self[0, other.length]
|
|
head == other
|
|
end
|
|
|
|
def ends_with?(other)
|
|
tail = self[-1 * other.length, other.length]
|
|
tail == other
|
|
end
|
|
end
|