Cabbage Logo
Back to Cabbage Site

Split string?

Say you have a path: C:\Users\Test\File.mp3, and want to split the string:


at the last slash to


Does anyone know how to achieve this in Csound?

strsub is probably the way to do this.
Although, to know where to split the string you’ll need to work back though it and find the location of the final ‘’. For that you can use strchar:

1 Like

You an also use the cabbageGetFile utility opcode.

1 Like

Nice! I think I made some elaborate UDO for this a while back and there you go and write an opcode that does it all!