Click here to Skip to main content
12,451,662 members (63,286 online)
Click here to Skip to main content
Alternatives (1)
Add your own
alternative version

Tagged as

Stats

11.7K views
1 bookmarked
Posted

Parsing Strings to Boolean

, 15 Sep 2010 CPOL
Handy extension method that parses common boolean expressions

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

16 Sep 2010
Simon Dufour
If you don't need to check for other strings than True or False, then, you should use Boolean.Parse or Boolean.TryParse.// Return trueBoolean.Parse("true");// Return falseBoolean.Parse("false");// Exception.. you can prevent that from happening by using a try..catch// or using...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Enrique Albert
Software Developer (Senior)
Ireland Ireland
No Biography provided

Pro
Pro
| | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 15 Sep 2010
Article Copyright 2010 by Enrique Albert
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid