我假设:
String abc = "My Documents/FileName.txt".Split('/')[1]; // is not the quickest way
是吗?
String abc = "My Documents/FileName.txt"; abc = abc.Substring(abc.LastIndexOf('/') + 1);
这具有以下优点: