Home All Groups Group Topic Archive Search About

Is there a simple way to determine if a string satisfies the pattern *.txt

Author
16 Apr 2005 11:56 PM
Just Me
Given a string variable fileName
And a pattern *.txt  or  *.*  or    File?.exe


Is there a simple way to determine if fileName satisfies the pattern?


Thanks in advance

Author
17 Apr 2005 12:06 AM
Dennis
If you have the filename as a string and want to find out if it conforms to
the pattern's listed, check out the "Like" Operator.

If you are using FileInfo, you can use wildcards in the methods of that class.

Show quoteHide quote
"Just Me" wrote:

> Given a string variable fileName
> And a pattern *.txt  or  *.*  or    File?.exe
>
>
> Is there a simple way to determine if fileName satisfies the pattern?
>
>
> Thanks in advance
>
>
>
>
Author
17 Apr 2005 12:26 AM
Just Me
Looks like "Like" will work

Thanks

Show quoteHide quote
"Dennis" <Den***@discussions.microsoft.com> wrote in message
news:FA550481-4D75-4383-8CFF-6BEB00FCDFD9@microsoft.com...
> If you have the filename as a string and want to find out if it conforms
> to
> the pattern's listed, check out the "Like" Operator.
>
> If you are using FileInfo, you can use wildcards in the methods of that
> class.
>
> "Just Me" wrote:
>
>> Given a string variable fileName
>> And a pattern *.txt  or  *.*  or    File?.exe
>>
>>
>> Is there a simple way to determine if fileName satisfies the pattern?
>>
>>
>> Thanks in advance
>>
>>
>>
>>
Author
17 Apr 2005 12:11 AM
Herfried K. Wagner [MVP]
" Just Me" <gro***@a-znet.com> schrieb:
> [Double post]

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
17 Apr 2005 12:28 AM
Just Me
Only one post in my news reader.
Reply to the other to see if I see the reply?



Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:%235hNbGuQFHA.576@TK2MSFTNGP15.phx.gbl...
>" Just Me" <gro***@a-znet.com> schrieb:
>> [Double post]
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>