Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
text comparision
Karthic Ganesan
7/29/2008 2:05:00 PM
hi,
i need to check the text "Test" from a dropdown list that contains more
than 100 char.
i have taken the text from dropdown list and store it in a variable a.(i
dont know is it correct or not)
that is if i execute "puts a" statement then it shows "abcd efg hij Test
klmno pqrs tuvw xyz" .
now i need to check the text "Test" from variable a.
i have tried,
b="Test"
if a== %b%
and is no luck.
could anybody know how to perform this task?
--
Posted via
http://www.ruby-...
.
1 Answer
Farrel Lifson
7/29/2008 2:12:00 PM
0
2008/7/29 Karthic Ganesan <karthic.ganesan@gmail.com>:
> now i need to check the text "Test" from variable a.
> i have tried,
>
> b="Test"
> if a== %b%
>
> and is no luck.
>
> could anybody know how to perform this task?
Try using a regular expression:
b = /Test/
if b =~ a
# Do stuff
end
Farrel
--
Aimred - Ruby Development and Consulting
http://www....
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
text comparision
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password