2
프로그램을 디스플레이에 넣었으므로 검색중인 문자열이 있음을 분명히 볼 수 있습니다.string []. 텍스트가 배열에 있어도 일치하는 항목을 찾을 수 없습니다.
'보이지 않는'문자로 인해 작동하지 않을 수 있습니까?
var items = new List<string>(currComponent.Split(new string[]
{ "\r\n", "\n" }, StringSplitOptions.None));
string feedback = string.Empty;
foreach (string i in items)
{
feedback += i + ". ";
}
ScriptingObject.WriteLogMessage
("feedback:" + feedback + "<EOF>", true);
if (items.Contains(attributeDescription))
디스플레이의 결과는 가변 피드백 문구 '연소' 하지만 items.Contains("Flue")
그것을 찾을 수없는 포함을 보여준다. items
의 문자열이 정확히 일치하는 "Flue"
하지만 "Boiler Flue Type"
및 List.Contains()
검색하지 않기 때문에
Message: Status message: 2015-01-09 10:36:18 | feedback:_ ,. Boiler Flue Type.
Boiler make. Boiler Model. Gas Appliance Safety Protector. __.. . <EOF>
Next message: unable to process an Update Location record ...because of error:
item Flue not found .
고맙습니다. 그것이 정답입니다. –
나는 아직 로그에 쓰고있는 텍스트를 찾지 못하는이 문제에 봉착하고있다. 해당 데이터는 화면 캡처에서 가져옵니다. 보이지 않거나 인쇄 할 수없는 문자가 포함되어있을 수 있으며, 이는 .contains가 작동하지 못하도록합니다. –
_plain ASCII words_ (보일 러)와 같고 System.String으로 작업하고 있습니다. 어떤 문자 인코딩 문제도 생각할 수 없습니다. 새 코드도 게시 해보세요 ... –