[英]Int32.Parse(“356882”) generate exception System.FormatException: 'Input string was not in a correct format.'
I am trying to parse a string in c# but I am getting a format exception, the code I am using is:我正在尝试解析 c# 中的字符串,但出现格式异常,我使用的代码是:
int test;
test =Int32.Parse("356882");
I don't get why this generates an error, 356882 is an integer within the boundaries of an int32.我不明白为什么这会产生错误,356882 是 int32 边界内的 integer。
Any idea?任何想法?
Cheers干杯
Vincent文森特
356882 is an integer
356882 是 integer
Yes, it would be an integer.是的,它将是 integer。 "356882" is an integer.
“356882”是 integer。
But this is not what you are parsing.但这不是您要解析的内容。 Yor string is:
你的字符串是:
"356882" “356882”
There is a hidden fist character.有一个隐藏的拳头字符。 I copy pasted it from your text - my right key hangs one press.
我从您的文本中复制粘贴了它-我的右键挂起一按。 That hidden character is blocking parsing.
那个隐藏的字符正在阻止解析。
Now sure how it ends up there - copy/paste and what editor?现在确定它是如何结束的 - 复制/粘贴和什么编辑器?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.