0

Hi Guys ,
I have a line which is like this :-
"C:\\Users\\saurabh\\Desktop\\Projects\\Texts\\A Sign of the Times.txt"
how can i jus extract the last part of it which is
A Sign of the Times.

Thanks

2
Contributors
4
Replies
6
Views
8 Years
Discussion Span
Last Post by finito
0

Here pseudo code

Do streamreader untill null
{
    String readline = SreamLine;
}
MessageBox.Show(readline);
0

this is to reaqd the line.what i want to do is to get a substring froma sting.so if suppose i have string like C:\\Users\\saurabh\\Desktop\\Projects\\Texts\\A Sign of the Times.txt then i just want "A Sign of the Times" part of the string.Thanks for the help

0

I got it guys .This is what i was suppose to do

int coll = names[currentFile].LastIndexOf(@"\");
                string sub = names[currentFile].Substring(coll + 1);
                int coll2 = sub.LastIndexOf(@".");
                string sub2 = sub.Remove(coll2);
                item.article = sub2;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.