Rate this:
See more:
`D:\nageswararao\dec-14-12-night\Alumini_App\Alumini_App\Resume\NN_dd.doc`
In the above path I need to find the last occurrence of '\' and from that I would like to divide the path in two two strings.
Posted 15-Dec-12 1:03am
ntitish1.6K
Edited 15-Dec-12 1:07am
v2
André Kraak at 15-Dec-12 6:08am

DO NOT SHOUT when asking a question. When you use all capital letters it is seen as shouting on the Internet and considered rude. Next time when posting a question please use proper capitalization.
ntitish at 15-Dec-12 6:09am

sorry, but i not mean that.............

Rate this:

## Solution 1

You can use the Path class[^] for this.

Use the GetFullPath Method[^] to retrieve the path and GetFileName Method[^] for the file name.
Both links to the methods contain examples you can use.
Espen Harlinn at 16-Dec-12 6:12am

5'ed, as Path provides the required functionality :-D
Rate this:

## Solution 5

```string a = @"D:\nageswararao\dec-14-12-night\Alumini_App\Alumini_App\Resume\NN_dd.doc";
int lastIndex = a.LastIndexOf('\\');```
v2
Anuja Pawar Indore at 17-Dec-12 0:57am

MaulikDusara at 17-Dec-12 7:09am

Rate this:

## Solution 4

Hi,

```string strFilePath = @"D:\nageswararao\dec-14-12-night\Alumini_App\Alumini_App\Resume\NN_dd.doc";
MessageBox.Show( strFilePath.LastIndexOf('\\').ToString());```
Rate this:

## Solution 2

```string str = D:\nageswararao\dec-14-12-night\Alumini_App\Alumini_App\Resume\NN_dd.doc;   //will take input
string[] strArr = new string[];
int count = 0;
char[] splitchar = { ' ' };
strArr = str.Split(splitchar);//here u will get each word in array index now decide what u have to do
```
v2