While slowly implementing every detail for my screensaver skin with a player on it, I wanted to make sure that the blank/unknown info has a desirable replacement/substitute.
All is well until the Track Year info...
It works as expected when there is no track year (which returns 0), but fails when there is a track year (replaces all "0" with "----", as stated in the docs, which is disappointing).
Is there a way to make it replace ONLY if the result is just "0"?
creativegamer_03 wrote: ↑November 15th, 2021, 12:40 pm
While slowly implementing every detail for my screensaver skin with a player on it, I wanted to make sure that the blank/unknown info has a desirable replacement/substitute.
All is well until the Track Year info...
It works as expected when there is no track year (which returns 0), but fails when there is a track year (replaces all "0" with "----", as stated in the docs, which is disappointing).
Is there a way to make it replace ONLY if the result is just "0"?
You could use RegExpSubstitute=1 to substitute dashes when zero is the only character in the string, from the beginning(^) to the end($).
As an explanation of what is going on and why eclectic-tech's solution does work (because it definitely does), note that if using the original Substitute="0":"----" substitution, every 0 will be replaced by the appropriate string, because the substitution can be applied more times, so all 0s are substituted. If using eclectic-tech's solution (Substitute="^0$":"----"), the substitution goes on ONLY if 0 is the whole string returned by the measure, because as he said, ^ and $ character in the "^0$" part of the option means that between the beginning end the end of the string only one single 0 is allowed. If there is any other character, the substitution doesn't take place.