[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: string.find manual suggestion
- From: Ted Unangst <ted.unangst@...>
- Date: Wed, 13 Oct 2010 18:28:36 -0400
The manual does not specify the behavior of empty matches. Example:
print(string.find("hello", "z*"))
1 0
print(string.find("hello", "z*", 4))
4 3
I think this makes perfect sense (works well with string.sub), but it
wasn't predictable (how can the occurrence end before it starts?).
Clarifying that the second return value will be the position found
minus one would be really nice.