Check if character exists in string

L

Lars Brownies

I want to check if a string contains any of the following characters:
\/:*?"<>|#
What's the easiest way to do this?

Thanks,

Lars
 
J

John W. Vinson

I want to check if a string contains any of the following characters:
\/:*?"<>|#
What's the easiest way to do this?

Thanks,

Lars

A LIKE query:

If string LIKE "[\/:*?"<>|#]" Then
 
L

Lars Brownies

Thanks John! Works like a charm.

I had to add 2 asteriks and an extra ".
If str Like "*[\/:*?""<>|#]*" Then

Lars

John W. Vinson said:
I want to check if a string contains any of the following characters:
\/:*?"<>|#
What's the easiest way to do this?

Thanks,

Lars

A LIKE query:

If string LIKE "[\/:*?"<>|#]" Then
 
Top