473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Checking for valid characters

Is there an easy way to take an input string and check for valid characters?
For instance, I am working on an expense report in where the cells have to
have numeric data only. So if the user accidentally inputs a space
somewhere in the data string, the program will error and alert the user to
this fact.

Thanks for the information.

Brad
Nov 21 '05 #1
2 1591

"Brad" <al*******@sbcglobal.net> wrote
Is there an easy way to take an input string and check for valid characters?
For instance, I am working on an expense report in where the cells have to
have numeric data only. So if the user accidentally inputs a space
somewhere in the data string, the program will error and alert the user to
this fact.

Perhaps something like:

If strUserText Like "*[!0-9]*" Then
' Bad input
Else
' Good input
End If

LFS
Nov 21 '05 #2
Larry,

Thanks for the information. VB .Net has been a "learn as I go" process.

Brad

"Larry Serflaten" <se*******@usinternet.com> wrote in message
news:OP**************@tk2msftngp13.phx.gbl...

"Brad" <al*******@sbcglobal.net> wrote
Is there an easy way to take an input string and check for valid characters? For instance, I am working on an expense report in where the cells have to have numeric data only. So if the user accidentally inputs a space
somewhere in the data string, the program will error and alert the user to this fact.

Perhaps something like:

If strUserText Like "*[!0-9]*" Then
' Bad input
Else
' Good input
End If

LFS

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: John V | last post by:
What kind of regular expression pattern is needed to check if URL is valid? It's enought if most of cases are covered. I have PHP 4.x. Br
4
by: papillonimages | last post by:
Please can someone help me, I am trying to write a Regular Expression check for a valid (Windows) filename (cant believe I couldnt find one on the net already?!?!?!). Anyway, here is what I have...
2
by: mike | last post by:
I had a form like below that validated that a file was there before it would submit. <form name="attach" method="POST" action="run_this_pgm.cfm" enctype="multipart/form-data"...
14
by: tranky | last post by:
Hi, i'm italian...so...excuse me for my english. I've a little problem....in what manner i can check a textbox for know if it contain only character from A-Z (a-z), numbers (0-9), and underscore...
26
by: libsfan01 | last post by:
Hi all! Can anyone show me how to check and email field on a form for the existence of these two characters. Kind regards Marc
5
by: emma_middlebrook | last post by:
Hi I've found the rules that cover what is a valid attribute name here: http://www.w3.org/TR/2006/REC-xml-20060816/ 2.3 Common Syntactic Constructs Is there anything already in the dotnet...
10
by: SpreadTooThin | last post by:
Hi I'm writing a python script that creates directories from user input. Sometimes the user inputs characters that aren't valid characters for a file or directory name. Here are the characters...
10
by: Jerim79 | last post by:
I am working on form validation. I have a scheme that is working for me, except for 3 input fields. Zip, Phone, and Fax are the input fields. I want to do two tests. First I want to check to make...
2
by: joe2079 | last post by:
Hello all, I'm very much an SQL noobie and would appreciate any help I can get on this one... I need to do a security check on an input string whereby if any character outside the valid range...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.