Find Any Character in String1 in String2

  • Thread starter Thread starter Charles Law
  • Start date Start date
C

Charles Law

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
 
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
 
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
 
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 said:
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
 
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top