| | |
How do I delete the last character of a string
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
I assume you are putting your input to a textbox. So try this:
VB.NET Syntax (Toggle Plain Text)
TextBox1.Text = InputBox("Enter number") TextBox1.Text = TextBox1.Text.Substring(0, TextBox1.Text.Length - 1)
•
•
Join Date: Jan 2008
Posts: 65
Reputation:
Solved Threads: 4
•
•
•
•
I am a beginner in VB. I am trying to make a simple unit converter. Can please some body tell me how can I delete the last character of the number I enter in my inputbox?
thank you
TextboxName.Text.Length -1 as the other poster stated which will subtract the last number in the textbox
VB.NET Syntax (Toggle Plain Text)
Dim str As string str = "Ramy1" str = str.Remove(str.Length - 1); ' str = Ramy
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
i think wayne already answered this thread.
Last edited by Jx_Man; Feb 21st, 2008 at 11:25 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
Yes yes thanks JX
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- the middle character of a string (C++)
- How to Remove Newline character from a VB String (Visual Basic 4 / 5 / 6)
- Finding the Most Common Character in a String (Java)
Other Threads in the VB.NET Forum
- Previous Thread: validation
- Next Thread: unescaping uri in HttpWebRequest
Views: 22501 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 2008 access add application array assignment basic box button buttons center class click code combo convert cpu data database datagrid datagridview design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees error excel exists firewall function image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan picturebox port print printing printpreview problem record refresh regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml






