by Brian Harm (2 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 3rd February 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Get the characters out of a mixed string. Example..."337ANC444BBBD77XXC4" will be "ANCBBBDXXC"
API Declarations
'TextBox...............Text1
Text1.Text = NoIntegerString(Text1.Text)
End Sub
Public Function NoIntegerString(bla As String) As String
'look at bla. if bla char is an integer then do not show it
'rather save the interger
Dim StringLength As Integer
Dim StringPossition As Integer
Dim WhatIsThis As String
Dim StringOut As String
Dim IntOut As String
StringLength = Len(bla)
StringPossition = 1
Do Until StringPossition = StringLength + 1
WhatIsThis = Mid(bla, StringPossition, 1)
If WhatIsThis = "0" Or WhatIsThis = "1" Or WhatIsThis = "2" Or WhatIsThis = "3" Or WhatIsThis = "4" Or WhatIsThis = "5" Or WhatIsThis = "6" Or WhatIsThis = "7" Or WhatIsThis = "8" Or WhatIsThis = "9" Then
IntOut = IntOut & WhatIsThis
Else
StringOut = StringOut & WhatIsThis
End If
StringPossition = StringPossition + 1
Loop
NoIntegerString = StringOut
End Function
No comments have been posted about Get the characters out of a mixed string. Example...337ANC444BBBD77XXC4 will be ANCBBBDXXC. Why not be the first to post a comment about Get the characters out of a mixed string. Example...337ANC444BBBD77XXC4 will be ANCBBBDXXC.