我在 Textbox1 中有一个名为“lastname-132”的 AD 用户名,该字符串长度为 12,所以我想将用户名添加到 Textbox2,但缩短了,在 textbox2 中,由于其他原因,我只有一个字符串长度只有 10 个可用这个程序正在使用的工具,所以我不想一直手动转换它,只想用 onleave 事件自动转换它。
有人知道如何写这个吗?
所以最终结果应该是这样的。
'String length can be 20 max.
Textbox1.Text = "lastname-123"
'some code to convert it to this:
'String length 10 max. Numbers and the "-" should stay the same, but remove letters if necessary.
Textbox2.Text = "lastna-123"