Using "{#genre}/{#prefix}{title}" should only put a space in if #prefix contained only spaces. I have used a similar thing with the series name, and that will work how you want it. I'm not sure what would happen with "{#genre}/{#prefix} {title}". It might depend on the file system.
But, I'd probably do something like:
Code:
{#genre}/{#prefix:| | - }{title}
That will put " - " after the prefix if it is not empty. And if it is empty, nothing will be added.
You might want to look at doing this in a metadata plugboard. If this is the template for sending the book to the device, it is setting the filename and path. Whether you will see that when using the device depends on the device. A metadata plugboard can change the title in the metadata. Your Kindles will display this, not the file name.