VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



String Auto Backspace

by Tomas Tupy (6 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

With this extremely easy code, you can erase a character at the end of a string or in a textbox with a click of a button. Very easy code and every line is commented. DON'T forget to vote.

API Declarations
Dim backlength As Integer
Dim backString As String

Rate String Auto Backspace

Dim backlength As Integer 
'declare the variable in which the length will be stored
Dim backString As String 
'declare the string in which Text1 wil be stored
Private Sub Command1_Click()
backlength = Len(Text1.Text) 
'find the length of the text in the textbox
backString = Mid(Text1.Text, 1, (backlength - 1)) 
'save that text without the last character into the string
Text1.Text = backString 
'display the string in the text box
End Sub
'You can replace Text1.Text with a string name

Download this snippet    Add to My Saved Code

String Auto Backspace Comments

No comments have been posted about String Auto Backspace. Why not be the first to post a comment about String Auto Backspace.

Post your comment

Subject:
Message:
0/1000 characters