By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,557 Members | 1,406 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,557 IT Pros & Developers. It's quick & easy.

Regular Expression

P: n/a
Can someone tell me how to build an expression to match
this string "\filename.shx". This string is to be matched
in the full path to a file returned by the select file
dialog. I need to get the file name and the extension
from the returned string. TIA
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
JLong wrote:
Can someone tell me how to build an expression to match
this string "\filename.shx". This string is to be matched
in the full path to a file returned by the select file
dialog. I need to get the file name and the extension
from the returned string. TIA


See Path.GetExtension and Path.GetFileNameWithoutExtension
http://msdn.microsoft.com/library/de...thodsTopic.asp
Nov 21 '05 #2

P: n/a
"Doug Holton" <in****@spam.here> schrieb:
Can someone tell me how to build an expression to match this string
"\filename.shx". This string is to be matched in the full path to a file
returned by the select file dialog. I need to get the file name and the
extension from the returned string. TIA


See Path.GetExtension and Path.GetFileNameWithoutExtension
http://msdn.microsoft.com/library/de...thodsTopic.asp


In addition to that, you'll have to compare the filenames using text
comparison semantics on systems which don't support case-sensitive
filenames. This means that characters that differ in case are treated as
the same character. VB.NET uses text comparison semantics out of the box
when comparing strings using the '=' operator.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.