本文介绍了遮罩的内容文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助, 如何阅读maskedtextbox的一部分?例如,如果用户输入的数据是"123-456-789-444",我想将第二个被屏蔽的项("456")分配给label1.text 任何帮助将不胜感激.
Please help, How can I read a part of a maskedtextbox? for example if the data entered by the user is "123-456-789-444", I would like to assign the second masked item ("456") to label1.text Any help will be appreciated.
推荐答案您可以通过String.Split()方法来实现. 这是为您提供的解决方案. You can do it by String.Split() method. Here is the solution for you. string maskStr = "123-456-789-444"; int count = maskStr.Split('-').Length - 1; string[] masks = new string[count]; masks = maskStr.Split('-'); label1.Text = masks[1];
更多推荐
遮罩的内容文本框
发布评论