Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Help]Determining if a string contains numbers.[Solved]

[Help]Determining if a string contains numbers.[Solved]

Posts 1–6 of 6 · Page 1 of 1
♪~ ᕕ(ᐛ)ᕗ
♪~ ᕕ(ᐛ)ᕗ
[Help]Determining if a string contains numbers.[Solved]
hello, i want to make a function which checks if a value is a number or not....
i've got this;

Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For i As Integer = 0 To Integer.MaxValue
            If TextBox2.Text = CType(i, String) Then
                GoTo er
                Exit Sub
            Else
                i = 1
                TextBox3.Text = TextBox3.Text.Replace("//Created by Table Viewer v1.0 Beta", " " & ComboBox1.Text & " " & TextBox2.Text & ";" & vbNewLine & "//Created by Table Viewer v1.0 Beta")
                Exit For
            End If
        Next
er:
        MsgBox("The value name can't be an integer!", MsgBoxStyle.Exclamation, "Error")
    End Sub
But when I try it, and insert a number in the textbox it shows the message box but it adds the value to a list too I don't want it to the list
#1 · 15y ago
T0
T0P-CENT
Quote Originally Posted by 3Li0 View Post
hello, i want to make a function which checks if a value is a number or not....
i've got this;

Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        For i As Integer = 0 To Integer.MaxValue
            If TextBox2.Text = CType(i, String) Then
                GoTo er
                Exit Sub
            Else
                i = 1
                TextBox3.Text = TextBox3.Text.Replace("//Created by Table Viewer v1.0 Beta", " " & ComboBox1.Text & " " & TextBox2.Text & ";" & vbNewLine & "//Created by Table Viewer v1.0 Beta")
                Exit For
            End If
        Next
er:
        MsgBox("The value name can't be an integer!", MsgBoxStyle.Exclamation, "Error")
    End Sub
But when I try it, and insert a number in the textbox it shows the message box but it adds the value to a list too I don't want it to the list
Code:
For I As Integer = 0 To 9
            If TextBox1.Tex*****ntains(I) Then
                MsgBox("The value name can't be an integer!", MsgBoxStyle.Exclamation, "Error")
                Exit Sub
            End If
        Next
ComboBox1.Text & " " & TextBox2.Text & ";" & vbNewLine & "//Created by Table Viewer v1.0 Beta")
#2 · 15y ago
♪~ ᕕ(ᐛ)ᕗ
♪~ ᕕ(ᐛ)ᕗ
Quote Originally Posted by T0P-CENT View Post
Code:
If Not IsNumeric(TextBox1.Text) Then
TextBox3.Text = TextBox3.Text.Replace("//Created by Table Viewer v1.0 Beta", " " & ComboBox1.Text & " " & TextBox2.Text & ";" & vbNewLine & "//Created by Table Viewer v1.0 Beta")
Else
MsgBox("The value name can't be an integer!", MsgBoxStyle.Exclamation, "Error")
End If
omg!
It's kinda embarrassing, didn't come at my mid
thanks anyways...
#3 · 15y ago
T0
T0P-CENT
Quote Originally Posted by 3Li0 View Post
omg!
It's kinda embarrassing, didn't come at my mid
thanks anyways...
check the code again , i edited it isnumeric for somehow when i try a1 or any no. it passes
#4 · 15y ago
♪~ ᕕ(ᐛ)ᕗ
♪~ ᕕ(ᐛ)ᕗ
Quote Originally Posted by T0P-CENT View Post
check the code again , i edited it isnumeric for somehow when i try a1 or any no. it passes
no, no, no I don't want to add:
Only Numeric Values, but if they are values like:
A554ACE, it doesn't really matter, I'm making a Table viewer for reversing structs in C++
#5 · 15y ago
Hassan
Hassan
[highlight=vbnet]Dim i as string = "329495498"
If Microsoft.VisualBasic.IsNumeric(cint(i)) Then
TextBox3.Text = TextBox3.Text.Replace("//Created by Table Viewer v1.0 Beta", " " & ComboBox1.Text & " " & TextBox2.Text & ";" & vbNewLine & "//Created by Table Viewer v1.0 Beta")
Else
MsgBox("The value name can't be an integer!", MsgBoxStyle.Exclamation, "Error")
End If [/highlight]

Should be like that. If you want to check if the string is alphanumeric (contains alphabets and numbers) then use the following function:

First add this:

[highlight=vbnet]Public Function IsNumeric(ByVal [String] As String) As Boolean
For i As Integer = 0 To [String].Length - 1
If Not (AscW([String].Substring(i, 1)) >= 48 AndAlso AscW([String].Substring(i, 1)) <= 57) Then 'asc value range of numbers
Return False
End If
Next
Return True
End Function[/highlight]

Then this:

[highlight=vbnet]Public Function IsAlphaNumberic(ByVal [String] As String) As Boolean
For i As Integer = 0 To [String].Length - 1
If Not (IsNumeric([String].Substring(i, 1)) OrElse _
(AscW([String].Substring(i, 1)) >= 65 AndAlso AscW([String].Substring(i, 1)) <= 90) OrElse _
(AscW([String].Substring(i, 1)) >= 97 AndAlso AscW([String].Substring(i, 1)) <= 122)) Then
Return False
End If
Next
Return True
End Function
[/highlight]

Then call the IsAlphaNumeric function to check:

[highlight=vbnet]If IsAlphaNumeric("ABC123") Then
Msgbox ("")
Else
Msgbox ("/shofo")
End If [/highlight]

Taken from my post in snippets vault.
#6 · 15y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None