• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

how to find a data that is pure string or not in vb.net ?

how to check IsPureString() function in vb.net ?

if  (keycode>=65 and keycode<=92 )or (keycode >=97 and keycode<=122)  then

this is to validate ispurestring or not.    except this idea, what are the ways and libarary functions  available in vb.net  ?
1 Solution
Éric MoreauSenior .Net ConsultantCommented:
there is not much other ways.

one thing you need to be cautious, from your code you seem to use the keypress (or keydown) event. a user would be able to paste a numeric value if you only handle this event
David Johnson, CD, MVPOwnerCommented:
purestring() or ispurestring() is not a .net function

what are the ways and library functions  available in vb.net  ?

There are thousands of built-in functions available in .net, depending upon which version of .net you are referring to..

if (keycode>=65 and keycode<=90)or (keycode >=97 and keycode<=122)

Don't know where you got 92 but 90 is 'Z'
Is this an ASP.Net application you are using or a Windows application?
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

There is a function isLetter
You can loop through your string and verify that each character is letter or not.
Details of the function:
softwareachieverAuthor Commented:
my application is vb.net windows application
You can find vb.net code in the link I have provided.
Éric MoreauSenior .Net ConsultantCommented:
in the link provided by darjimaulik, click the VB tab.

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now