string separator = " > ";
string retStr = "";
int count = 0;
foreach (string s in retList)
{
count++;
if(!string.IsNullOrEmpty(s))
{
if (count < retList.Count)
retStr += s + separator;
else
retStr += s;
//count < retList.Count ? retStr += s + separator : retStr += s;
}
}
コメントを外した行はエラーになります:Only assignment, call, increment, decrement, and new object expressions can be used as a statement
。上記のif-caseと同等であるべきではありませんか?