README.md

December 4, 2022 ยท View on GitHub

_String Auto Backspace_

Description

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.

More Info

Submitted On
ByTomas Tupy
LevelBeginner
User Rating3.8 (19 globes from 5 users)
CompatibilityVB 5.0, VB 6.0
CategoryString Manipulation
WorldVisual Basic
Archive File

API Declarations

Dim backlength As Integer
Dim backString As String

Source Code

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