Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Syntax (change order of words when there's a comma present). (Read 262 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Syntax (change order of words when there's a comma present).

Background:
I listen to radio stations using Foobar (with "Dynamic track titles" enabled).

What I'm trying to accomplish:
Is there a way to reverse the order of words (and remove the comma) whenever a comma is detected in %artist%?

Example:
Retrieved: Lewis, Huey
Displayed: Huey Lewis

Thank you.

Re: Syntax (change order of words when there's a comma present).

Reply #1
This should do it:

Code: [Select]
$puts(pos,$strstr(%artist%,','))$ifgreater($get(pos),0,$substr(%artist%,$add($get(pos),2),$len(%artist%)) $substr(%artist%,0,$sub($get(pos),1)),%artist%)

Re: Syntax (change order of words when there's a comma present).

Reply #2
Thank you so much @snotlicker it works great.  :)

 
SimplePortal 1.0.0 RC1 © 2008-2021