iLMS知識社群歷程檔登入
位置: 黃國哲 > Unity
1100829 包含Contain和列舉List 與Foreach用法
by 黃國哲 2021-08-29 22:59:17, 回應(0), 人氣(478)

">參考影片   在9:07



using System.Collections.Generic ;

public List<string> datalist ;

start()

dataList.Add ("0.你說啊");
dataList.Add ("1.你好啊");

foreach (var page in datalist)
{
if (page.Contains("說")) //多一個條件,有符合才顯示
{
Debug.Log(page)
}
}









回應