Simple query, need help replacing some text
<p>I've got a login, and most of my users type in the following type of username "mydomain\Y98765" the to get into our website. I have recently upgraded our website, and no longer need them to type in the "mydomain\" within th username. I know I need to use the replace command to replace "mydomain\" with "", however, my server keeps crashing with my attempts. This is the code that works providing user has not typed in mydomain. </p>

<pre><code>UserManager Usermanager = new UserManager();

UserData userdata = Usermanager.Login(UserName.Text, Password.Text, "DC=my,DC=domain,DC=co,DC=uk");
</code></pre>

<p>This is what I have attempted but crashes the server. Can someone help please</p>

<pre><code>string username = UserName.Replace("mydomain\\","");
UserData userdata = Usermanager.Login(username, Password.Text, "DC=my,DC=domain,DC=co,DC=uk");
</code></pre>
