I have a textbox and i want to take off the last character of that word for using in another purpose.
Is this possible?
Loading
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.
AlanPosted Aug 13, 2008, 11:23 AM
For that you need:
string m = textBox8.Text.Substring(0, textBox8.Text.Length - 1);
Arnold PetronaPosted Aug 13, 2008, 10:59 AM
Good Morning
I test it but it give me a wrong answer
I have the following
the string is as follow ; "1.3.6.1.2.1.2.1.0" . Now i have to take of the last one ( the 0) with the code that you give me is as follow in mine program
string m = texbox8.text.Text.Substring(this.textbox8.text.length-1,1);
during mine running process it give me the m as 0.
but i need to have m as "1.3.6.1.2.1.2.1."
Ryan AlfordPosted Aug 12, 2008, 9:19 AM
Arnold PetronaPosted Aug 12, 2008, 12:25 AM
AlexPosted Aug 12, 2008, 12:02 AM
string s = textBox1.Text.Substring(textBox1.Text.Length - 1, 1);
char c = textBox1.Text.ToCharArray()[textBox1.Text.Length - 1];