<div >
IsNum( </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff;">string</span> Rx = <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800000;">@"</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800000;">^[1-9]\d*$</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #800000;">"</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000;">; </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff;">if</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000;"> (Regex.IsMatch(Str,Rx)) { </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff;">return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff;">true</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000;">; } </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff;">else</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000;"> { </span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff;">return</span> <span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #0000ff;">false</span><span https://m.jb51.cc/tag/color/" target="_blank" >color</a>: #000000;">; } }</span></pre>
总结
以上是内存溢出为你收集整理的判断一个字符串是否是数字全部内容,希望文章能够帮你解决判断一个字符串是否是数字所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)