Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to employ the Substring method from this site:

http://msdn.microsoft.com/en-us/library/aa903372%28v=vs.71%29.aspx[^]

This was a little vague.

I have a string: n="123456789"

I want to delete the last two digits to get:

n="1234567"

How do I do that?
Posted
Comments
[no name] 16-Aug-14 12:59pm    
Okaaaayyyy... You should probably read the documentation for SubString then not sure what is so vague about it.

n = n.SubString(0, n.Length - 2) should do what you want.

1 solution

This link[^] should give you a more detailed explanation.
More examples can be found here - VB.NET Substring[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900