Active 7 years, 9 months ago. Viewed 38k times. Substring a. LastIndexOf '. Length - a. Replace b, "" ; Console. WriteLine c ; Is there any better way of doing this? Improve this question. Ashley Medway 5 5 bronze badges. Mathematics Mathematics 1 1 gold badge 8 8 silver badges 27 27 bronze badges. This site is codereview, not stackoverflow. We should migrate good question, not borderline question. Show 2 more comments. Active Oldest Votes. GetFileNameWithoutExtension Returns the file name of the specified path string without the extension.
GetFileNameWithoutExtension "asdasdasd. If you want to create one by yourself, why not just use this? Substring 0, index ; P. I'm currently using URL Rewriting in my website. If the URL is www. I saw this type of behavior in StackOverflow.
Can I achieve this? If YES How??? Improve this question. Krishna Thota Krishna Thota 5, 11 11 gold badges 53 53 silver badges 78 78 bronze badges. It just says methods of URL Rewriting. You may have to install a rewrite module in IIS and then set it in web. Add a comment. Active Oldest Votes. Improve this answer.
Community Bot 1 1 1 silver badge. Active Oldest Votes. Add System. ListBox list0. GetFileNameWithoutExtension d. ToList ; Warning. Not able to test this now. Improve this answer. Steve Steve k 21 21 gold badges silver badges bronze badges. Thanks for support, but I received the error: 'System. Path — Kevin Gosse.
Add a using directive to your code using System. IO; or add the namespace before the Path class. Steve Works fine now! Thank you very much! Sign up or log in Sign up using Google. Sign up using Facebook.
0コメント