HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: trelain on 2014-06-14 23:10:52

Title: Case sensitive Library search using $strcmp
Post by: trelain on 2014-06-14 23:10:52
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%.
Title: Case sensitive Library search using $strcmp
Post by: foosion on 2014-06-14 23:24:02
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
Title: Case sensitive Library search using $strcmp
Post by: trelain on 2014-06-14 23:59:06
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.