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

String Comparision

Hi,

Whats the best way to compare string?
I have a text box, the text of which should not contain "P.O. Box" or "Box"
or "PO Box"

Stephen.
Nov 18 '05 #1
4 1130
> Whats the best way to compare string?
I have a text box, the text of which should not contain "P.O. Box" or "Box" or "PO Box"


You could use regular expresions.

Otherwise, if you're fairly confident those are the most likely/only
combinations, then you can just use instr:

if (instr(yourString, "P.O.") > 0) or (instr(yourString, "PO ") > 0) or
(instr(yourString, "Box") > 0) then...

-Darrel
Nov 18 '05 #2
Maybe create a checkbox they can select if they have a PO Box and if checked
allow them to put a number in there. Or you can do an txtBox.IndexOf("Box")
= 0 but you might have problems if they live on John Box Street.
"Stephen" wrote:
Hi,

Whats the best way to compare string?
I have a text box, the text of which should not contain "P.O. Box" or "Box"
or "PO Box"

Stephen.

Nov 18 '05 #3
> Whats the best way to compare string?

Hemp is biodegradeable, but nylon is much stronger.

--
;-),
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Stephen" <st*********@hotmail.com> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
Hi,

Whats the best way to compare string?
I have a text box, the text of which should not contain "P.O. Box" or "Box" or "PO Box"

Stephen.

Nov 18 '05 #4
Hi Stephen,

Sorry about the little joke. I was feeling mischievous.

After re-reading your question, as well as the answers you've already
received, I'm thinking that it might help to suggest that, rather than
defining what should NOT be in the text box, what exactly SHOULD be in the
text box? That would be a better way to approach the question.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Stephen" <st*********@hotmail.com> wrote in message
news:u1**************@TK2MSFTNGP10.phx.gbl...
Hi,

Whats the best way to compare string?
I have a text box, the text of which should not contain "P.O. Box" or "Box" or "PO Box"

Stephen.

Nov 18 '05 #5

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

Similar topics

7
by: Forecast | last post by:
I run the following code in UNIX compiled by g++ 3.3.2 successfully. : // proj2.cc: returns a dynamic vector and prints out at main~~ : // : #include <iostream> : #include <vector> : : using...
6
by: rakesh | last post by:
Hi, I have a requirement in which I need to search a string in a file stored on a harddisk. String which needs to be searched would be stored in a file with delimiter as new line character. some...
32
by: Wolfgang Draxinger | last post by:
I understand that it is perfectly possible to store UTF-8 strings in a std::string, however doing so can cause some implicaions. E.g. you can't count the amount of characters by length() | size()....
3
by: kd | last post by:
Hi All, How to perform case-insensitive comparision of strings? Would there be some kind of an indicator, which when set to true, would allow case-insenitive comparision of strings using...
2
by: nirav.lulla | last post by:
I have been given the task to come up with Requirements, Comparision and Migration document from Shadow Direct to DB2 Connect. I am very new much to all this, but kind of know a little bit about...
30
by: Steve Edwards | last post by:
Hi, I'm re-writing some code that had relied on some platform/third-party dependent utility functions, as I want to make it more portable. Is there a standard C/C++/stl routine for changing an stl...
33
by: genc_ymeri | last post by:
Hi over there, Propably this subject is discussed over and over several times. I did google it too but I was a little bit surprised what I read on internet when it comes 'when to use what'. Most...
8
by: abhi147 | last post by:
Hi all , I need to convert a 32 bit string containing hex digits like "76d408cedd600bb578bc0256a751cea2" into it's corresponding 16bit ascii value like "vÎÝ` µx¼V§Q΢" . Now the presence of...
9
by: subramanian100in | last post by:
Suppose we have char *a = "test message" ; Consider the comparison if (a == "string") ..... Here "string" is an array of characters. So shouldn't the compiler
35
by: user34 | last post by:
(Sorry if this gets posted twice) Hi all. I am trying to learn C.As a simple exercise i tried to write a code which would compare two strings using pointers. However i am not getting the correct...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.