Showing posts with label How to replace last character of an input. Show all posts
Showing posts with label How to replace last character of an input. Show all posts

Tuesday, December 10, 2019

Replace last charactor

I had a requirement where I need to replace all occurrences of \ in end of a string.

Regex helped me to achieved the expected result. The code for this is as shown below.

Regex.Replace(txtDomain.Text.Trim, "/+$", "")


Cheers
Samitha