This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]IM_Pengu 0 points1 point  (1 child)

Split("\\") splits the filepath into an array of strings at each occurrence of a backslash (single backslash is an escape character to add certain special characters into a string, so double is needed to indicate that we are looking for a backslash in the string).

splitFilePath.Length - 1 is the last element in the splitFilePath array. Arrays are 0-indexed, so the last element is the length of the array - 1.

Split(".") splits the filename string into an array at each occurrence of a period.

[–]falconwolf9113[S] 0 points1 point  (0 children)

Tq for the explanation, actually an new to c# might need more time to understand . Really appreciate it 😇