Figure code and uniform code merger Below I have a simple method that will merge a figure code with a uniform code, let me talk more about that and how it works so you guys have a neat understanding.

Each character on my gaming emulator has a unique figure code, unless their dressed the exact same of course but unlikely, here is an example of a few figure codes.

lg-285-76.hr-155-31.sh-300-92.ca-1819-63.hd-209-2.ch-3030-76
he-3149-1331.sh-3035-110.hr-170-61.fa-3276-72.ch-255-110.hd-209-2.lg-280-1331
ch-210-110.hd-209-7.hr-828-1407.he-3082-63.lg-280-1408.cp-3309-77.sh-290-92


Above is 3 examples of a figure string, I wont go as far as explaining each part as its not relevant in this question (as of now).

So, each character has a figure code and then there is a few uniform codes. Now the uniform codes usually only contain the ch and lg parts for chest and leg, which is usually all a uniform needs, except I have coded this method to replace any parts of the uniform into the figure code with the uniform part. Here is a few examples of the uniform figure codes..

(Legs, Shoes and Chest)
lg-285-76.sh-300-92.ca-1819-63.ch-3030-76
(Legs and Chest)
lg-280-110.ch-1004-110


So what am I asking?
I am asking for some ways to improve the performance of this method.

Edit: I've added functionality to choose which parts you want to replace, with a list string as the second parameter, which is default empty (replaces all parts).

Here is the method:

public static string ReturnUniform(string uniform, string figure, List&lt;string&gt; partsToReplace = new List&lt;string&gt;())
{
    List&lt;string&gt; uniformParts = uniform.Split('.').ToList();
    List&lt;string&gt; figureParts = uniform.Split('.').ToList();

    foreach (string uniformPart in uniformParts)
    {
        string[] parts = uniformPart.Split('-');
        string part = parts[0];

        if (partsToReplace.Any() &amp;&amp; !partsToReplace.Contains(part))
        {
            continue;
        }

        if (figure.Contains(part + "-"))
        {
            var indexOfItem = figureParts.ToList().FindIndex(value =&gt; value.StartsWith(part));
            figureParts[indexOfItem] = uniformPart;
        }
        else
        {
            figureParts.Add(uniformPart);
        }
    }

    return string.Join(".", figureParts);
}
If I understood you correctly what you need is to make this method faster.
Firstly, you need to answer one simple question is that really what you NEED, this method does not look that time consuming at all (unless you have hundreads of elements in that string). Have you benchmarked it and saw that it consumes a lot of time? 

EDIT: it came to me that you might be asking about performance of your idea, if so - for me it looks good enough.

If you really need to make this method faster here is what I can see:

1. Do not use foreach loop. If you decided to make uniform.Split('.') a list take advantage of it. Change your loop to for

2. Do not use LINQ at all, it is known for being time consuming (since it enumerates everythingcall enumerator in every function).

partsToReplace.Any() &amp;&amp; !partsToReplace.Contains(part)


can be changed to for loop when you do Any by List.Count method and Contains by simply checking every element. Exactly the same thing is applicable to if (figure.Contains(part + "-")) and var indexOfItem = figureParts.ToList().FindIndex(value =&gt; value.StartsWith(part));

in the latter I think you do not need to make ToList() but I have no compiler at hand to check it.

Note
Those changes are micro optimalisations, if your application is slow it is probably because of some other part. Plase do propper benchmark to check this.

Also : I think there should be List&lt;string&gt; figureParts = figure.Split('.').ToList();