Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/igo/trie.rb

Instance Method Summary collapse

Instance Method Details

#starts_with?(prefix) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/igo/trie.rb', line 4

def starts_with?(prefix)
  prefix = prefix.to_s
  self[0, prefix.length] == prefix
end