taking last two special character in a string
how to capture last two special character only in a string & leave the other special character in a string.
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.
VulpesPosted Feb 1, 2015, 11:49 AM
Try this:
The output is:
Francis SusaimichaelPosted Feb 1, 2015, 8:42 AM
string strYourString = "Some string with Special Characters:!@#$%^&*(";
// Will give the last 2 charcters *(
string strExtracted = strYourString.Substring(strYourString.Length - 2);
Response.Write(strExtracted);