VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Take out Numbers from a string that is characters and numbers mixed. The Numbers are in order they

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)

Take out Numbers from a string that is characters and numbers mixed. The Numbers are in order they appear in the string. EX

API Declarations


'TextBox..................Text1

Rate Take out Numbers from a string that is characters and numbers mixed. The Numbers are in order they



    '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
    GetTheNumber = IntOut

End Function

Private Sub Command1_Click()
Text1.Text = NoIntegerString(Text1.Text)
End Sub

Download this snippet    Add to My Saved Code

Take out Numbers from a string that is characters and numbers mixed. The Numbers are in order they Comments

No comments have been posted about Take out Numbers from a string that is characters and numbers mixed. The Numbers are in order they . Why not be the first to post a comment about Take out Numbers from a string that is characters and numbers mixed. The Numbers are in order they .

Post your comment

Subject:
Message:
0/1000 characters