Hi all,
I've checked the title formatting help page and this thread, and I think I'm on the right lines ...
I've got a string and want to remove a range of characters that may or may not exist in the string.
Here's what I've got and to make things easier (for me at least, I've added a '0' where later nothing will be, so for example:
$replace(happy,pp,) will look like this (purely so it's easier to read, obviously I'm not doing this with foobar2000):
$replace(happy,pp,0) which should give "ha00y" and when I remove the 0's it will give me "hay".
Okay, here's my code:
$puts(out1,$lower(%album%)\$lower(%artist%_%title%))
$puts(out2,$replace($get(out1),?,0,!,0,-,0,',0,,,0,[,0,],0,(,0,),0, ,0))
$trim($get(out2))
Here's the characters I want to remove:
? ! - ' , [ ] ( ) and " " (spaces)
So later I'll just delete the 0's ...
$puts(out1,$lower(%album%)\$lower(%artist%_%title%))
$puts(out2,$replace($get(out1),?,,!,,-,,',,,,,[,,],,(,,),, ,))
$trim($get(out2))
The problem is this isn't working. Also if these characters aren't in the string what happens? (I assume they're ignored?)
Can someone tell me what I'm doing wrong?
Any help greatly appreciated.
Thanks.
C.