Hi

Here this function will accept a string as parameter and that will
split that string with the character \\
and will return the last word in that string array

for eg:-
I am sending the string "India\\USA\\UK\\France\\China\\Japan"
the function will return Japan

HOPE THIS WILL HELP YOU


On Feb 22, 9:01 pm, Learner <[email protected]> wrote:
> Hi,
>
>   Can some one explain the below function
>
> public static string ExtractUserName(string path)
>     {
>         string[] userPath = path.Split(new char[] { '\\' });
>         return userPath[userPath.Length - 1];
>     }
>
> Thanks,
>
> L

Reply via email to