0

I have a string like this:

"C:\Users\rajkumar2\Desktop\@Bot\UK portal\Version 5.2"

I want output something like this

"C:\Users\rajkumar2\Desktop@Bot\UK portal\Version 5.2"

I am trying this code but didn't get the desired output.

Regex.Replace("C:\\Users\\rajkumar2\\Desktop\\@Bot\\UK portal\\Version 5.2","[^\w\.\,!""$%^&*\(\)-_\']","")

1 Answer 1

2

If I understand the replacement correctly, then a regular non regex replace might work here:

Dim input As String = "C:\Users\rajkumar2\Desktop\@Bot\UK portal\Version 5.2"
Dim output As String = input.Replace("\@", "@")
Console.WriteLine(output)

This prints:

C:\Users\rajkumar2\Desktop@Bot\UK portal\Version 5.2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.