KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I know that this works to get the first item of an array string aString = @"hello/all\this\is/a\test"; string firstItemOfSplit = aString.Split(new char[] {'\\', '/'})[0]; //firstItemOfSplit = hello is there a way to get the last item? Something like string aString = @"hello/all\this\is/a\test"; string lastItemOfSplit = aString.Split(new char[] {'\\', '/'})[index.last]; //lastItemOfSplit = test
Tags (comma-separated)
Save Edits
Cancel