easy question i hope

C

Caspar Bl

hi i need to strip out some boolean operators from search input
this is what i need to remove
params[:search_input].gsub!(/AND|OR|&&|||/,'')
it all works except for || which i suppose is because it is interpreted
as meaning or nothing or nothing. so how can i remove the || from the
input?
regards
caspar
 
J

Jan Svitok

hi i need to strip out some boolean operators from search input
this is what i need to remove
params[:search_input].gsub!(/AND|OR|&&|||/,'')
it all works except for || which i suppose is because it is interpreted
as meaning or nothing or nothing. so how can i remove the || from the
input?
regards
caspar
\|\| (escape with \)
 
T

Tim Pease

hi i need to strip out some boolean operators from search input
this is what i need to remove
params[:search_input].gsub!(/AND|OR|&&|||/,'')
it all works except for || which i suppose is because it is interpreted
as meaning or nothing or nothing. so how can i remove the || from the
input?
regards
caspar

params[:search_input].gsub!(/AND|OR|&&|\|\|/, '')

Blessings,
TwP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top