A small change (two bytes longer) to your solution makes it perfect, I think, for all cases
ClassMethod findShort(s) As %Integer
{
f i=1:1 ret:$locate(" "_s_" "," [^ ]{"_i_"} ") i
}BUT, and that's, what I want to say: this function is an awesome demonstration of economic nature of ObjectScript in comparison to Java. Your one-liner vs. a whole page of code... I love ObjectScript!
Sorry, that had to be said...
- Log in to post comments