473,396 Members | 1,765 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,396 software developers and data experts.

String cleansing

Given a short string that should only contain an (integer) number, is there
a way to filter out anything that is not a number?
Many thanks.
Patrick.

Nov 16 '05 #1
2 1833
use the following method

private static Regex _isNumber = new Regex(@"^\d+$")

public static bool IsInteger(string theValue

Match m = _isNumber.Match(theValue)
return m.Success
} //IsInteg

Regards
AMAL
Nov 16 '05 #2
"Patrick de Ridder" <wa********@all.here> wrote in message news:<10***************@news-01.evisp.enertel.nl>...
Given a short string that should only contain an (integer) number, is there
a way to filter out anything that is not a number?
Many thanks.
Patrick.


Hi,
A Tip. Try using regular expressions.
Nov 16 '05 #3

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

Similar topics

5
by: Andy | last post by:
Does anyone know of a deduplication and data cleansing tool that works with Access databases? Thanks Andy
8
by: moondaddy | last post by:
I'm writing an app in vb.net 1.1 and I need to parse strings that look similar to the one below. All 5 rows will make up one string. I have a form where a use can copy/paste data like what you...
7
by: kangaroo | last post by:
Hello, I have a column of type VARCHAR, storing some generally character data. A few of the values in that column are in fact numbers represented as strings (e.g., "12345"). At some moment I...
5
by: midhunmathe | last post by:
Hello, I get an error #', hexadecimal value 0x07, is an invalid character. Line 2, position 6358. on the XMLTextReader.Read() call on a particular node of my XML document. I need this data...
11
by: bcurtu | last post by:
Hi, I have a BIIIIIG problem with the next query: cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s) """,( eid_list))
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.