.net how do I ask what a string starts with?
.net how do I ask what a string starts with?
(OP)
Sorry if this is in the wrong forum for this question
I am writing a macro to save a SolidWorks drawing as a PDF and add some information to the filename at the same time.
I also would like it to save the file in a specific folder on the system dependant on the start of the filename.
I have the file name as a string, but I want to be able to write something along the lines of:
If the filename starts with "V", put it in this folder, else if it starts with "MD", put it in this folder, and so on, ignoring any subsequent characters in the filename.
I hope I've given enough information to be clear, any ideas anyone?
I am writing a macro to save a SolidWorks drawing as a PDF and add some information to the filename at the same time.
I also would like it to save the file in a specific folder on the system dependant on the start of the filename.
I have the file name as a string, but I want to be able to write something along the lines of:
If the filename starts with "V", put it in this folder, else if it starts with "MD", put it in this folder, and so on, ignoring any subsequent characters in the filename.
I hope I've given enough information to be clear, any ideas anyone?






RE: .net how do I ask what a string starts with?
RE: .net how do I ask what a string starts with?
TOP
CSWP, BSSE
www.engtran.com www.niswug.org
www.linkedin.com/in/engineeringtransport
Phenom IIx6 1100T = 8GB = FX1400 = XP64SP2 = SW2009SP3
"Node news is good news."
RE: .net how do I ask what a string starts with?
RE: .net how do I ask what a string starts with?
Anytime you have to search a string regular expressions are the way to go. They are also known as regex. They have been implemented in Windows programming languages for years.
TOP
CSWP, BSSE
www.engtran.com www.niswug.org
www.linkedin.com/in/engineeringtransport
Phenom IIx6 1100T = 8GB = FX1400 = XP64SP2 = SW2009SP3
"Node news is good news."
RE: .net how do I ask what a string starts with?
ht