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

How can i check the String letters?

How can i check the String letters?
i have a textbox and will filled with numbers.
i want to check if the number contain a '0' in font of the numbers,
e.g. '090',i would like to cut the 1st '0', that will change to '90'.
and i want to check whether it has a space there and return an error
message. e.g. '0 9 0', then it will return an error.

i really dont know how to do it? please give me some guidliance,
thanks.

Aug 15 '06 #1
2 1602
Hi,
i would like to cut the 1st '0'
You can try CString::TrimLeft
e.g. CString str = _T ("090");
str = str.Trimeft (_T ('0'));
Note: it will not erase only the first '0', it will trim all leading '0's.
e.g. CString str = _T ("00090");
>i want to check whether it has a space there and return an error message. e.g. '0 9 0', then it will return an error
try CString::Find
e.g. CString str = _T ("0 9 0");
//trim leading '0'
str = str.Trimeft (_T ('0'));

//Search space
if( str.Find (_T (' ')) != -1 )
{
//found space, do what you want
}
Yours,
Michael

"NEMA" wrote:
How can i check the String letters?
i have a textbox and will filled with numbers.
i want to check if the number contain a '0' in font of the numbers,
e.g. '090',i would like to cut the 1st '0', that will change to '90'.
and i want to check whether it has a space there and return an error
message. e.g. '0 9 0', then it will return an error.

i really dont know how to do it? please give me some guidliance,
thanks.

Aug 15 '06 #2

"NEMA" <re*******@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
How can i check the String letters?
i have a textbox and will filled with numbers.
i want to check if the number contain a '0' in font of the numbers,
e.g. '090',i would like to cut the 1st '0', that will change to '90'.
and i want to check whether it has a space there and return an error
message. e.g. '0 9 0', then it will return an error.
Sounds like you want to normalize a integer's string representation. Try
using Integer.TryParse to find out if it's a valid number (will catch spaces
or any other non-digit characters), and then ToString on the result to
format it the way you like, with/without leading zeros, etc.
>
i really dont know how to do it? please give me some guidliance,
thanks.

Aug 23 '06 #3

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

Similar topics

1
by: ratlhead | last post by:
Hey all, I've provided a form for a client of the company I work for that basically emails the form data to an email address. Only a couple of the many fields are required...nothing too fancy....
2
by: Edward K. Ream | last post by:
From the documentation for the string module at: C:\Python23\Doc\Python-Docs-2.3.1\lib\module-string.html letters: The concatenation of the strings lowercase and uppercase described below....
21
by: Andreas Lobinger | last post by:
Aloha, i wanted to ask another problem, but as i started to build an example... How to generate (memory and time)-efficient a string containing random characters? I have never worked with...
11
by: James Stroud | last post by:
Hello, I am looking for a nice way to take only those charachters from a string that are in another string and make a new string: >>> astr = "Bob Carol Ted Alice" >>> letters = "adB" >>>...
3
by: Raed Sawalha | last post by:
I have the following letters; string letters = "a;b;c....to z"; the I need to replace the incoming string which containing letters above with integer 1 i did following for(int...
3
by: Amy | last post by:
Hi, I have 6 If Then Else statements I was supposed to write. I did so but I know that they have to be wrong because they all look the same. Could someone take a look at them and point me in the...
3
by: sadhana | last post by:
Given a sequence of uppercase letters, we want to remove all but one occurrence of each letter, doing it in such a way that the remaining letters are in alphabetical order. Of course, there may be no...
0
by: clintp | last post by:
I've seen a few people asking for this elsewhere, so here's a basic implementation of a string trie in C#. I'm using this to load and search a dictionary of about two hundred thousand words. It's...
5
by: ashurack | last post by:
I found a stored procedure online a while back and want to inplement it. The only problem is that it doesn't check to see if the number generated is currently in use in the DB. I know it's really...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.