簡體   English   中英

Int32.Parse(“356882”) 生成異常 System.FormatException: '輸入字符串的格式不正確。'

[英]Int32.Parse(“356882”) generate exception System.FormatException: 'Input string was not in a correct format.'

我正在嘗試解析 c# 中的字符串,但出現格式異常,我使用的代碼是:

int test;
test =Int32.Parse("356882");

我不明白為什么這會產生錯誤,356882 是 int32 邊界內的 integer。

任何想法?

干杯

文森特

356882 是 integer

是的,它將是 integer。 “356882”是 integer。

但這不是您要解析的內容。 你的字符串是:

“356882”

有一個隱藏的拳頭字符。 我從您的文本中復制粘貼了它-我的右鍵掛起一按。 那個隱藏的字符正在阻止解析。

現在確定它是如何結束的 - 復制/粘貼和什么編輯器?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM