473,395 Members | 1,689 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.

Find Any Character in String1 in String2

I'm sure I will kick myself when you tell me, but is there a simple way to
test for the existence of any character in string1 being present in string2?
For example, if s1 = "abracadabra" and s2 = "synonym" the result is false,
but if s2 = "pelican" the answer is true.

TIA

Charles
Nov 21 '05 #1
4 1627
No matter, I have it: IndexOfAny

I do have another question though: why is InvalidPathChars incomplete under
Windows? For example, it does not contain \ or /.

Charles
"Charles Law" <bl***@nowhere.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
I'm sure I will kick myself when you tell me, but is there a simple way to
test for the existence of any character in string1 being present in
string2? For example, if s1 = "abracadabra" and s2 = "synonym" the result
is false, but if s2 = "pelican" the answer is true.

TIA

Charles

Nov 21 '05 #2
Hi,
I do have another question though: why is InvalidPathChars incomplete under Windows? For example, it does not contain \ or /.

Charles


Because "\" and "/" are valid path characters. 8=]

"C:\TEMP\"

Roman
Nov 21 '05 #3
It's too bad (or at least I can't find it) an invalid chars for a file name
within a path.
--
Dennis in Houston
"Dragon" wrote:
Hi,
I do have another question though: why is InvalidPathChars incomplete

under
Windows? For example, it does not contain \ or /.

Charles


Because "\" and "/" are valid path characters. 8=]

"C:\TEMP\"

Roman

Nov 21 '05 #4
Hmm...

As Dennis says later, I too could not find a File.InvalidChars or
Path.InvalidFileChars method, so assumed that InvalidPathChars must do the
job. But, as you observe, it does not because \ and / are actually valid in
a path.

Notably, InvalidPathChars also does not include * or ?, and yet these are
not valid in a path. Perhaps that would have been a better example :-)

Charles
"Dragon" <no@spam.please> wrote in message
news:OV**************@TK2MSFTNGP09.phx.gbl...
Hi,
I do have another question though: why is InvalidPathChars incomplete

under
Windows? For example, it does not contain \ or /.

Charles


Because "\" and "/" are valid path characters. 8=]

"C:\TEMP\"

Roman

Nov 21 '05 #5

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

Similar topics

6
by: MLH | last post by:
SELECT Adresses.RawData FROM Adresses WHERE (((Adresses.RawData)=InStr(1,,Chr$(13)))); Its not doing the trick for me and I'm not sure why.
8
by: Dawn Minnis | last post by:
Hey guys If I have a program (see codeSnippet1) that I compile to be called test.o Then run it as test.o n n 2 3 4 I want the code to be able to strip out the two characters at the start...
3
by: linguae | last post by:
Hello. In my C program, I have an array of character pointers. I'm trying to input character strings to each index of the character pointer array using scanf(), but when I run the program, I get...
10
by: Federico G. Babelis | last post by:
Hi, I need to extract a string from another string separated by "," like a .csv file. for example I have this string: String1 = 000,federico,00,439827HGH,1233,FGB,0000,00,000 and from that...
5
by: Chris Mahoney | last post by:
Hi I have a string containing a phrase, and I want to search for a particular word and get its index. I've tried a couple of things already: InStr(phrase, word) - this doesn't work because it...
1
by: mariyana | last post by:
We display an expression in excel , in which there are also some small boxes being diaplayed in expression. somes boxes are getting removed when we give replace(string1,vbnewline,"") but some...
2
by: santhescript01 | last post by:
Hi everyone, I got a macro that performs a find and replace function on a text.It's working fine but for some unicode character it replaces with weird character despite of original text character. ...
2
by: slizorn | last post by:
hi guys, i need to make a tree traversal algorithm that would help me search the tree.. creating a method to search a tree to find the position of node and to return its pointer value basically i...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.