Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我假设:
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);
这具有以下优点: