Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: String search backwards?
Gennady Bystritsky
1/24/2006 8:10:00 PM
n = orig_str.rindex(sub_str)
Does it help?
Gennady.
-----Original Message-----
From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf
Of Toby DiPasquale
Sent: Tuesday, January 24, 2006 12:06
To: ruby-talk ML
Subject: String search backwards?
Hi all,
Can Ruby search a string backwards? I can't find any reference to this
in the docs or online, but it seems as if you should be able to do this.
What I would like, ideally, is a method like:
n = rstrstr( orig_str, sub_str)
where n is the starting index of the last occurrence of sub_str in
orig_str. Anybody know how to do this? I tried using the 'r' modifier to
// but that failed as well.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: String search backwards?
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