Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Case sensitive Library search using $strcmp (Read 1337 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Case sensitive Library search using $strcmp

At some point my files that have Roman numerals II, III, in the filename got corrupted to Ii, Iii.    I'm trying to locate and correct them using the $strcmp function but am having trouble constructing the query properly to do a case sensitive search for the string "Ii" anywhere within %filename%.

Case sensitive Library search using $strcmp

Reply #1
The $strcmp function checks whether its arguments are equal. You need $strcmp which checks if the first argument contains the second argument.
Code: [Select]
"$if($strstr(%filename%,Ii),1,0)" IS 1

 

Case sensitive Library search using $strcmp

Reply #2
That worked perfectly...Thanks!    The doc for $strstr on the Title Formatting Reference webpage does not imply that it can be done case-sensitive, hence my confusion:

$strstr(s1,s2)
Finds first occurence of string s2 in string s1.

$strcmp(s1,s2)
Performs a case-sensitive comparison of the strings s1 and s2.