Help - Search - Members - Calendar
Full Version: what's the difference between these lines?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
kyller
Sorry for noob question, but I don't see any differences between:

$replace(%path%,%filename_ext%,)folder.jpg

and

$replace(%path%,%filename_ext%,folder.jpg)


thanks smile.gif
wraithdu
As far as the resulting string, nothing. The second one is just cleaner code.
Yotsuya
The first line takes the full path of the file, replaces the filename and extension with nothing, then appends "folder.jpg".

The second line takes the full path of the file and replaces the filename and extension with "folder.jpg"

The two are functionally identical but only because the filename and extension appear at the end of the path. If we were dealing with something other than file pathnames the two approaches would result in radically different results, I personally view the second line as cleaner code although both are perfectly valid.
kyller
Got it!
Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.