01-06-2015 06:04 PM
The above code is returning the value of found as 0. Anybody knows why? Even though I am ignoring case and removing trailing blanks from the arguments. If I remove the 't' modifier, the value is returned correctly as 1. If I use STRIP function on the second argument, the value is again returned correctly.
Thanks for the help.
01-06-2015 06:15 PM
Probably because it ends up trimming the space out of the list of delimiter characters. Add 'S' to the modifiers. Or add other characters such as period and comma to the list of delimiter characters.. Also making the list of delimiters a variable instead of an in-line character constant seems to also make it work.
01-06-2015 06:25 PM
It says in the the docu:
So it appears trimming the character argument removes blanks from the list of word delimiters. Initially not really intuitive to me but then with a bit more thinking isn't this exactly what I would expect to happen if passing in a variable as character argument? So using the 't' switch with an explicit string as character argument is definitely not the right thing to do.
found1=findw('Art festival.','art',' ','it');
found1=0 found2=1 found3=1