您好我想弄清楚如何查看字符串,找到第一个字母,然后从该索引点删除.
例如
string test = "5604495Alpha";
Run Code Online (Sandbox Code Playgroud)
我需要通过这个字符串,"A"从那一点开始查找和删除
谢谢
我有一个方法返回一个List<DateTime>但是我在方法中运行的代码给了我一个List<string>
如何将我的线路转换List<string>为a ?List<DateTime>return
它基本上是一种方法,它接收照片列表并返回其日期拍摄属性的列表;
//retrieves the datetime WITHOUT loading the whole image
public List<DateTime> GetDateTakenFromImage(List<string> path)
{
List<string> dateTaken = new List<string>();
int cnt = 0;
while (cnt < path.Count())
{
using (FileStream fs = new FileStream(path[cnt], FileMode.Open, FileAccess.Read))
using (Image myImage = Image.FromStream(fs, false, false))
{
PropertyItem propItem = myImage.GetPropertyItem(36867);
dateTaken[cnt] = r.Replace(Encoding.UTF8.GetString(propItem.Value), "-", 2);
}
cnt++;
}
return dateTaken;
Run Code Online (Sandbox Code Playgroud)
我从网站上获得了这些代码,所以我不确定是否可以让它返回到 List<DateTime>
我想我可以使提供的答案适用于此代码.
谢谢!
我正在尝试制作一个if语句来检查是否TextBox有文本.
所以像这样:
if (textbox1 has text)
{
//Then do this..
}
Run Code Online (Sandbox Code Playgroud)
我怎么写"textbox1有文字"?