Skip to content

Instantly share code, notes, and snippets.

@AndrewVos
Created September 12, 2011 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AndrewVos/1211989 to your computer and use it in GitHub Desktop.
Save AndrewVos/1211989 to your computer and use it in GitHub Desktop.
example
def read_words filename
File.read(filename).split(/\s+/)
end
def remove_useless_words words
useless_words = ["word1", "word2"]
words - useless_words
end
words = read_words "filename.txt"
words = remove_useless_words words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment