Link to home
Start Free TrialLog in
Avatar of CoolDev2014
CoolDev2014

asked on

c# replace method

I try to replace \ to string.empty like the following code, but it never works. Can you show me the right way to do that?


(firstName.Text).Replace(@"\", "")
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Replace usually returns the converted string.
Something like this:
firstName.Text = (firstName.Text).Replace(@"\", "")
Avatar of CoolDev2014
CoolDev2014

ASKER

but i have something like below
string fileName = genericSrv.Encryption(firstName.Text).Replace(@"\", "")
how can i do that?
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
*no points*

I agree with Andy's assessment:  You wouldn't want to change the encrypted string because you might not be able to restore it back. It sounds like you intended to modify the pre-encrypted string, and then to encrypt that result, which is what Andy's code demonstrates.
andy: another excellent help. If you have time, I have another one for you.

https://www.experts-exchange.com/questions/28366375/asp-net-ajax-tool-kit-calendar.html