Showing posts with label replace last character of the string. Show all posts
Showing posts with label replace last character of the string. 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