String manipulation (how do I and/or improvement suggestion)

I have a file in my project with a name like:

foo.faa.blah.xml

I want to chop off the first part, "foo.", and convert this into:

faa.blah.xml

Yeah, it would be a LOT easier if it was the last part (the extension), but it's not and I have to work with that. Yes, I could write a custom task to do this, but I'd rather not as that would involve a lot of distribution to different developers, debugging, etc, for just some simple string manipulation. And yes, I tried writing a recursive target when I chop the filename up with %(filename) and then put it back together, but you can't have circular (ie recursive) target references in MSBuild....

So, my question is, can anyone come up with a possible way to do this using standard MSBuild tasks

Or, I'd like to make a suggestion for MSBuild v1.1, add some string manipulation tasks beyond just the %(filename), %(extention) transforms stuff....

Thanks

-A



Answer this question

String manipulation (how do I and/or improvement suggestion)

  • MikaelN

    You'll need to write a string manipulation task, unfortunately. There's no built-in way to do this in MSBuild. We'll add it to our suggestion list!

    Neil



  • Maciej Boniecki

    Thanks for the response Neil. Looks like I'll dig in and write that task....

    -A


  • String manipulation (how do I and/or improvement suggestion)