2021年3月16日星期二

I want to remove special characters from File name without affecting extension in c#

I have a file name let's say o example - Hello%@Im&an#Full-Stack+.Developer.pdf

I want to replace all the special characters from the file name with underscore _ and the result should be something like that.

Hello__Im_an_Full_Stack_Developer.pdf

Can anyone help me in making the regex for this task, my current regex is this [^\.\w]

https://stackoverflow.com/questions/66667263/i-want-to-remove-special-characters-from-file-name-without-affecting-extension-i March 17, 2021 at 01:04PM

没有评论:

发表评论