listContainsNoCase(list, substring)
This function just finds the substring, and tells you which item contains that sub string. It is important to understand that this item is not searching for a list item, just for a sub string. Consider the following example:
listContainsNoCase("Date,Decimal,Image,Integer,Long Text,Rich Text,Simple Text", "Text")=5Notice how it found that item number 5 has the word "Text" in it, even though "Text" is not the complete item.
listFindNoCase(list, value)
This function finds a value in a list, and tells you which item matches the value. It compares the value to the list item, and only accepts complete matches. So, consider the following examples:
listFindNoCase("Date,Decimal,Image,Integer,Long Text,Rich Text,Simple Text", "Text")=0Notice how in the first example above, no item was found. This is because there is no single item with value = "Text". However, it did find "Simple Text" in the second example above.
listFindNoCase("Date,Decimal,Image,Integer,Long Text,Rich Text,Simple Text", "Simple Text")=7
Of course the same is true for listFind, and listContains, but those are case-sensitive.
Incidentally, I put this one in the "duh" category, because I think that the names are reversed. The first usage should be named listFind, and the second should be named listContains.
Hope this helps.
1 comment:
Good comparison between this two functions. I have yet to see a good need for listContains, and every code block I've seen using it really wanted listFind instead!
Post a Comment