Given a filesystem path, is there a shorter way to extract the filename without its extension?

I program in WPF C#. I have e.g. the following path: C:\Program Files\hello.txt and I want to extract hello from it. The path is a string retrieved from a database. Currently I’m using the following code to split the path by ‘\’ and then split again by ‘.’: string path = “C:\\Program Files\\hello.txt”; string[] pathArr … Read more

javac is not recognized as an internal or external command, operable program or batch file [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 8 years ago. Improve this question I am experiencing an error while trying to compile Java programs. I am on Windows (this is … Read more

Why does sudo change the PATH? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 3 months ago. The community reviewed whether to reopen this question 3 months ago and left it closed: Original close reason(s) were not resolved Improve … Read more

Get current folder path

I want to create a program that converts files. I would like the user to be able to place the executable file in any directory, and when executing that program (double-clicking on the .exe) I want the program to process all the files within the current folder where the exe file exists. How can the … Read more