Skip to content

acheddir/AutoParse

 
 

Repository files navigation

What & Why?

AutoParse is a simple wrapper to .NET's TryParse methods that are found on many of the standard types. It takes away the need to use the out parameters and also provides an overload for custom parsing.


Typical tryparse usage looks like this:

	
		int number;
		if(int.TryParse("123456", out number))
			// we parsed
		else
			// we didn't
	

In cases where you don't really have any conditional logic, but don't want to fail if the value cannot be parsed, AutoParse simplifies it:

	
		var number = "123456".Parse<int>();
	

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%