From: Bigmac Turdsplash Date: 2009-05-06T12:58:38+09:00 Subject: Re: if string = "mike" then print "Hi mike" Nobuyoshi Nakada wrote: > Hi, > > At Wed, 6 May 2009 10:43:23 +0900, > Bigmac Turdsplash wrote in [ruby-talk:335871]: >> so, im only a few days into ruby, im working on some tcp and there is a >> problem with my client.rb... if str == ???? this if statement is always >> skipped and im not sure why? > > #gets method returns a string with a newline if you ended the > input with enter. You can chomp it or use double Ctrl-D > instead of enter. Oh, wow... a bit confused at first but then i googled ruby chomp and then it made sence, when you press enter \n if string.chomp == "mike" print "hello mike\n" system("calc.exe") # how can i execute calc.exe and continue with the script well calc is still running???? -- Posted via http://www.ruby-forum.com/.