How to duplicate items and upper case each item?

17 Views Asked by At

In MSBuild, it's easy to duplicate a property and upper case the value:

<PropertyGroup>
    <Name>Sarah</Name>
    <UpperName>$(Name.ToUpper())</UpperName>
</PropertyGroup>

How can I duplicate each item of item type Names, upper case it, and create a new item type UpperNames ?

<ItemGroup>
    <Names Include="Tim" />
    <Names Include="Sam" />
</ItemGroup>
1

There are 1 best solutions below

0
Colonel Panic On BEST ANSWER

Like so:

<UpperNames Include="@(Names->ToUpper())" />