looking for string within a string
how can i get a string from within a string
i mean i want to get the url string[code] http://www.whatever.com/anylink/ from within anchor tag.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Feb 16, 2011, 4:20 AM
Suthish NairPosted Feb 15, 2011, 3:11 PM
Did above solution helped you, or let us know.
If its to get url from anchor control, then its simple.
Mahesh ChandPosted Feb 15, 2011, 6:10 AM
Here is a code example that will give you a substring starting at 5th char and next 3 characters.
string str = "Mahesh Chand";
string sub = str.SubString(5, 3);
If you do not know the length, you can use IndexOfAny and LastIndexOfAny methods to find out position of last "/" within a string.