Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //creates an array of strings, split along the slashes
- // ie {"c://", "users", "jtilson" etc}
- string[] an_array = @"C:\\Users\\jtilson\\Desktop\\Metrics\\Advance Directives_Metrics x3A 134308.xls".Split('\\');
- //uses the length of the array minus one as an index, grabbing the last string out of the index
- string last_item = an_array[an_array.Length - 1];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement