Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

VB.NET Help...


ghost's Avatar
0 0

Is there any way to remove the last digit of a string in VB.NET?

Example: "Hello. This is a string.." and I want to remove the last "."


ghost's Avatar
0 0

Example:

Dim str As String
str = "Hello. This is a string.." 

str = Left(str, str.Length-1)

ghost's Avatar
0 0

Thanks, could you explain that a little please?


ghost's Avatar
0 0

Left() is a function for retrieving the leftmost characters from a string. It takes two arguments, the string and the length of the string that should be extracted from the first string.

Basically, he sets str to be the n characters from the original string. In this case the length of the string minus one. Thus removing the last character.