[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to extract a word at a given position in a string?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 10 Mar 2011 11:00:13 -0300
> So, I want to extract the word in this string whose limits surround
> the position clicked by the user. Is there some efficient way of
> searching for the beginning and end of a word around a given position
> that doesn't involve reversing the string or capturing all words until
> I find one whose limits enclose the initial position?
What is wrong with reversing the string ('string.reverse')?