Apply mask to a string

后端 未结 2 521
夕颜
夕颜 2021-01-18 02:42

I am reading a string ID value from a table. When the ID was input by the user, it was done with an input mask that the user defined, so the mask could have been something

2条回答
  •  野的像风
    2021-01-18 03:12

    This does exactly what I need. The only downside is that it ties me to the Windows Forms assembly.

            MaskedTextBox mtb = new MaskedTextBox("FR999_999999");
            mtb.Text = "123456789";
            return mtb.Text;
    

提交回复
热议问题