'Clear C# String from memory - Angular

I'm trying to clear the memory contents of a C# string for security reasons. I am using a ngmodel to have the user enter their username and password, once I have the password string I convert it to SecureString. However, since the password started as a plain string it is being shown in the browser memory dump.

How can I clear it from memory or at least zero it out?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source