本文介绍了如何在我的代码中阻止一些标点符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
有人能指导我找出如何在我的代码中阻止一些标点符号吗?
我想输入一个浮点数,并且我不希望逗号与点."相符,但是¬
像这样的真实逗号,我绝对不知道如何利用常规¬
为此表达.
我的代码如下所示:
Hi everybody,
would somebody please guide me in finding out how to block some punctuation in my code?
I''d like to enter a floating point number and I don''t want a comma with the point ".", but ¬
the comma with the real comma like this ", I have absolutely no idea of how to utilize regular ¬
expression for this.
My code looks something like this:
float value = Convert.ToSingle(Console.Readline());
string rex = @"[0-9],";
// I don't know how to continue from here on
有人可以帮我吗?
Stefan
Can somebody please help me?
Stefan
推荐答案
[+-]?\d+\,\d+
这篇关于如何在我的代码中阻止一些标点符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!