【发布时间】:2016-01-26 09:31:13
【问题描述】:
我想从下面的字符串数组中提取 Guid 并希望输出如下:
Output:Log.txt,Logging.txt
string[] str = new string[] { "1250a2d5-cd40-4bcc-a979-9d6f2cd62b9fLog.txt", "bdb31966-e3c4-4344-b02c-305c0eb0fa0aLogging.txt" }; //file name are Log.txt and Logging.txt
List<string> list= new List<string>();
foreach (var item in str)
{
if (!string.IsNullOrEmpty(item))
{
list.Add(); // here i want to store Log.txt and Logging.txt
}
}
如何做到这一点??
【问题讨论】:
-
list.Add("Log.txt"):)