mirror of
https://github.com/TracksApp/tracks.git
synced 2026-04-02 10:27:18 +02: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
|