我需要比较两个字符串列表,并找出相似的元素。例如:
List<string> listA = {"ProfileHeight", "ProfileWidth", "WebThickness"}
List<string> listB ={"ProfileHeightVisibility", "ProfileWidthVisibility", "WebThicknessVisibility", "FlangeThicknessVisibility", "DepthVisibility"}
我想知道是否可以使用Linq。我希望结果是一个列表,其中包含ListB中名称与ListA中字符串相似的元素。其中语句“ProfileHeightVisibility.Contains(“ProfileHeight”)= true”。