Ruby Programming - 15 - Find and Replace Program

preview_player
Показать описание
Ruby programming tutorial. Ruby find and replace program.

★☆★ SIGNUP TO GET MY RUBY BOOK FOR FREE ★☆★

★☆★ FOLLOW ME BELOW ★☆★

★☆★ NOTES ★☆★
Рекомендации по теме
Комментарии
Автор

Awesome video my dude I'm learning alot from you!

tonystarks
Автор

The Plaintiff Blackburn has requested that the defendant no longer contact her.

biscoitor
Автор

Great videos! Any way to not make the removal case-sensitive?

AndyW
Автор

Why do the speech marks  in + (" ") need to be in parenthesis?

wendycampbell
Автор

could be as simple as that? text[word] = replace

victorsalvans
Автор

hi thanks Jake what is the function of .each do ?

desmondade
Автор

What if i have multiple identifiers like space, coma, pull stop in the document. could you please explain

Bhatim
Автор

u shall try to remove a word "her" that dot in the end of the sentence doing bad things. actually, any punctuation will break that rule we did.

olexanderburyak
Автор

Is it necessary to put parentheses around the quotes in the if/else statement? I used just quotes with a space and it seemed to work ok

tactteam
Автор

Wild Academy great job teaching please respond but this is the way to get it so you could just open the file and not command promp
puts "Paste Your Document Here"
document = gets.chomp

puts "What word would you like removed"
remove = gets.chomp

puts "What word would you like there instead"

target_words = document.split(" ")
new_word = gets.chomp

target_words.each do |a_word|
   if a_word != remove
   print a_word + (" ")
   else print new_word + (" ")
   
   puts ", press enter to close the program"
   end_program = gets.chomp
   end
   end

DerpyFelicia
Автор

Her is the program from day 15
#!/usr/bin/env ruby
puts "Paste your document here:"
document = gets.chomp
puts "What word would you like removed?"
remove = gets.chonp
target_word = document.split(" ")
target_words.each do |a_word|
  if a word != remove
    print a word + (" ")
  else print "RMOVED "
  end
end
When I pull it into the Command prompt I receive an error

Any suggestions

bwinborg
Автор

There's a gem that reads your clipboard to make Ruby detects what you have copied before, just saying...

MarcoCarmonaT
visit shbcf.ru