Geeks With Blogs
Fórmulas e Cenas Object Reference Not Set to an Instance of an Object
If you have a "{" or "}" inside a string when using string.format you will get the error mentioned in the title.

To fix this you must double the charater.

Error Example: 
string teste = string.Format(" This is a {teste} {0} ", mystring);

Correct Example:
string teste = string.Format(" This is a {{teste}} {0} ", mystring);v
Posted on Monday, December 19, 2011 9:46 AM Geral , C# | Back to top


Comments on this post: string.Format input string was not in a correct format

# re: string.Format input string was not in a correct format
Requesting Gravatar...
como soluciono este problema en mi nomina
Left by victor on Sep 10, 2014 11:35 PM

# re: string.Format input string was not in a correct format
Requesting Gravatar...
input string was not in a correct format
Left by mauro on Oct 10, 2014 3:21 AM

Your comment:
 (will show your gravatar)


Copyright © Sglima | Powered by: GeeksWithBlogs.net