Remove domain information from login id in C#

后端 未结 8 2488
谎友^
谎友^ 2021-02-12 12:02

I would like to remove the domain/computer information from a login id in C#. So, I would like to make either \"Domain\\me\" or \"Domain\\me\" just \"me\". I could always chec

8条回答
  •  离开以前
    2021-02-12 12:33

            string theString = "domain\\me";
            theString = theString.Split(new char[] { '\\' })[theString.Split(new char[] { '\\' }).Length - 1];
    

提交回复
热议问题