I recently started a internship where I get to code UiPath which is all new to me. I’m wondering (and I hope I can phrase this correctly) if there is a way to remove the extension of a filename (if there is one) using regular expression, whilst passing the argument to it’s function.
For ex. I want to print my file “exampleFile.exe” as just “exampleFile” without actually changing the variable itself.
I cant figure out how to incorporate the RegEx I currently have to remove everything after the last “.” found in a string. This is the expression I have: /.[^.]*$/
I will also append a screenshot of the actual code I’m working with.
This code currently creates a file named “(Current file name).xml_metadata.xml” and I of course only want .xml at the very end
You shouldn’t use + to put things together into a full path and filename. This can result in incorrect or missing \ characters in the path. Use Path.Combine