Check for length in a string
If I understand correctly, your frustration is with the necessary computation for knowing whether to print Result or Result: temp - childname. That's because you're doing more steps than necessary.

Instead of:


Calculating the (ChildName - Name) string
Trimming any whitespaces in the resulting string
And then checking if this string is empty


You could just check if both the Name and ChildName are equal. If they are, your variable temp isn't used. Also, since result is written independently of such calculation, you could always print it.

So, I would suggest exchanging

foreach (var item in items) {
    string temp = item.ChildName.Replace(item.Name, "").Trim();
    if (temp.Length == 0) {
        Console.WriteLine(string.Format("{0}","Result"));
    } else {
        Console.WriteLine(string.Format("{0}: {1} - {2}", "Result", temp, item.Name));
    }
}


for

foreach (var item in items) {
    Console.Write("Result");

    if (item.Name != item.ChildName) {
        string childNameWithoutName = item.ChildName.Replace(item.Name, "").Trim();
        Console.Write(string.Format(": {1} - {2}", childNameWithoutName, item.Name));
    }

    Console.WriteLine();
}