遮罩的内容文本框

编程入门 行业动态 更新时间:2024-10-18 01:33:34
本文介绍了遮罩的内容文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请帮助, 如何阅读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];

更多推荐

遮罩的内容文本框

本文发布于:2023-11-24 23:23:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627325.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本框   内容

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!