July 12, 201115 yr i can easily obtain information and write to forms i can open files and read them with File.open("file.txt", "r") do |ini| while (line = ini.gets) puts line end end i have a simple tool to match strings string=john if string=~ /(john)/ puts "match" else puts "no match" end but how can do the two together? i have a list of usernames and when a user inputs a username via a form it will search through the text file and if ok they register ELSE choose another i need somehing like????????STUCKKKKK File.open("file.txt", "r") do |ini| while (line = ini.gets) end end if line=~ /(john)/ puts "match" else puts "no match" end please help!!! Edited July 12, 201115 yr by webknit
Create an account or sign in to comment