📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form frmTrim
Caption = "Trimming spaces with LTrim, Rtrim and Trim"
ClientHeight = 1830
ClientLeft = 60
ClientTop = 345
ClientWidth = 4935
LinkTopic = "Form1"
ScaleHeight = 1830
ScaleWidth = 4935
StartUpPosition = 3 'Windows Default
Begin VB.ListBox lstOutput
Height = 645
Left = 0
TabIndex = 3
Top = 1200
Width = 4935
End
Begin VB.TextBox txtInput
Height = 285
Left = 0
TabIndex = 2
Top = 360
Width = 4935
End
Begin VB.CommandButton cmdTrim
Caption = "Trim space characters"
Height = 375
Left = 0
TabIndex = 1
Top = 720
Width = 1815
End
Begin VB.Label lblInput
Caption = "Enter string with leading and trailing spaces"
Height = 255
Left = 0
TabIndex = 0
Top = 120
Width = 3375
End
End
Attribute VB_Name = "frmTrim"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig. 8.7
' Using LTrim, RTrim and Trim to remove
' leading and trailing spaces on a string
Option Explicit
Private Sub cmdTrim_Click()
Call lstOutput.Clear
Call lstOutput.AddItem("***" & LTrim$(txtInput.Text) & _
"***")
Call lstOutput.AddItem("***" & RTrim$(txtInput.Text) & _
"***")
Call lstOutput.AddItem("***" & Trim$(txtInput.Text) & _
"***")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -