PDA

View Full Version : String manipulation in LUA (directory paths)



BruceH
March 23rd, 2003, 12:15 PM
I am using the winamp3 plugin to allow control of winamp from an RC9200 Touch screen remote.

I would like to make a "play the album this track is from" button.

To do this I intend to:

1) Get playstring eg. c:\mp3s\artist\album\01 - trackname.mp3
2) remove "01 - trackmame.mp3"
3) append "album.m3u"

I would then execute this path to play the album.

so to get to the point, how would I would I strip the track name from the string?

a) Split the string by "\" then rebuild the first 4 sections?
b) Find the 4th "\" then remove all after it?

How would I code these?

Thanks in advance,
Bruce.