KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this method for grabbing the file name from a string URI. What can I do to make it more robust? private string GetFileName(string hrefLink) { string[] parts = hrefLink.Split('/'); string fileName = ""; if (parts.Length > 0) fileName = parts[parts.Length - 1]; else fileName = hrefLink; return fileName; }
Tags (comma-separated)
Save Edits
Cancel