>>Not so. This is a very simple thing I posted above. In such a simple case, the other cases would be handled differently. You'd need strings bigger than 100 chars before len would be slower and then for all the people who say m. is not important, the differences are not important enough to suggest that doing the conditional check in the loop is better most of the time.
>
>I still wonder why would
>
>>lcString = left(m.lcString,len(m.lcString)-1)
>
>be better than
>
>lcString = trim(m.lcString,1, ',')
For me a more relevant question would be to find a way to strip the trailing comma in an expression that has something like these:
inlist(upper(MyTable.MyField),'TEST1','TEST2',)
or
inlist(upper(MyTable.MyField),'TEST1','TEST2','TEST3',)
taking into account the the entire expression can have other expressions. For example, the entire string could be something like this:
"MyTable.MyField2 = '123' and inlist(upper(MyTable.MyField),'TEST1','TEST2',) and MyTable.MyField3 > 33"
So I need to find - within the long expression - if the "inlist()" has a trailing comma.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham