2013-05-16 2 views
-1

나는 목록 객체에서 문자열 목록을 결합하는 방법은 무엇입니까?

public class Dim_Location 
{ 
    public int ID{ get; set; } 
    public string LocationName{ get; set; } 
    public string ClienId{ get; set; } 
} 

private List<string> loadLocation(int clientIdx) 
{ 
    List<Dim_Location> LocationList = dim_Location.GetLocation(clientIdx); 
     //Combine here List<ID+";"+LocationName> and make List<string> 
} 

가 지금은 LocationList에서 List<ID+";"+LocationName>를 얻을 싶어 같은 ID와 이름과 위치의 목록을 가지고있다.

+0

이 문제를 직접 해결할 때 어떤 문제가 있었습니까? – Servy

답변

2
var result = LocationList.Select(x => x.ID + ";" + x.LocationName); 
관련 문제