VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



RemoveLiteralsAddIns remove literals from Strings. Create AddIns which can remove literals from the

by Bhuwan Chand Joshi (69 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 3rd September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

RemoveLiteralsAddIns remove literals from Strings. Create AddIns which can remove literals from the strings.

API Declarations


'Select AddIns Project
'The program will remove ":" and "-" from the Strings
'You can write it for any other literals.
Public VBInstance as BVIDE.VBE
Public Connect as Connect
Option Explicit

Rate RemoveLiteralsAddIns remove literals from Strings. Create AddIns which can remove literals from the



'Add two Labels controls over the frmAddIN form
'Change the Caption of Label controls as
'StringWithLiterals and StringWithoutLiterals
'Add two text box controls over the frmAddIn form
'Change the name of the textbox control as
'txtStringWithLiterals and txtStringWithoutLiterals
'Put a command button over the frmAddIn form
'Set the name and caption of command button as
'cmdRemoveLiterals and RemoveLiterals
'Type the code given below in code module.
Private Sub CancelButton_Click()
Connect.Hide
End Sub
Private Sub cmdRemoveLiterals_Click()
Dim StringWithoutLiterals as String
StringWithoutLiterals=RemoveLiterals(txtStringWithLiterals.text)
txtStringWithoutLiterals.Text=StringWithoutLiterals
End Sub
Public Function RemoveLiterals(strLiteral as String) As String
Dim tempStr as String,finalStr as String
tempStr=Mid$(strLiteral,1,1)
Dim ctr as Integer
Do While tempStr <> ""
ctr=ctr+1
tempStr=Mid$(strLiteral,ctr,1)
If tempStr<>":" And tempStr<>"-" then
finalStr=finalStr+tempStr
End If
Loop
RemoveLiterals=finalStr
End Function


Download this snippet    Add to My Saved Code

RemoveLiteralsAddIns remove literals from Strings. Create AddIns which can remove literals from the Comments

No comments have been posted about RemoveLiteralsAddIns remove literals from Strings. Create AddIns which can remove literals from the. Why not be the first to post a comment about RemoveLiteralsAddIns remove literals from Strings. Create AddIns which can remove literals from the.

Post your comment

Subject:
Message:
0/1000 characters