我有以下字符串:"10222002750400447092095835"
我希望它像这样显示:10 2220 0275 0400 4470 9209 5835
我尝试了以下操作,但没有任何结果:
[DisplayFormat(DataFormatString = "{0:00 0000 0000 0000 0000 0000 0000}", ApplyFormatInEditMode = true)]
或
[DisplayFormat(DataFormatString = "{0:## #### #### #### #### #### ####}", ApplyFormatInEditMode = true)]
我做错了什么?
最佳答案
我相信您正在寻找的是字符串屏蔽。见下文。
Stackoverflow - How to mask a string Stackoverflow - Apply mask to string
关于c# - 数据注释 - DisplayFormat - 格式化数字字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14759582/