Mercurial > repos > IBBoard
comparison CustomMath/NumberParser.cs @ 17:dfb7cb94c169
Add number parser class with static method for ints
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 26 Jan 2009 20:30:03 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
16:0352fa33ee8f | 17:dfb7cb94c169 |
---|---|
1 // This file (NumberParser.cs) is a part of the IBBoard utils library and is copyright 2009 IBBoard. | |
2 // | |
3 // The file and the library/program it is in are licensed under the GNU LGPL license. Please see COPYING.LGPL for more information and the full license. | |
4 | |
5 using System; | |
6 | |
7 namespace IBBoard | |
8 { | |
9 public class NumberParser | |
10 { | |
11 public static int ParseAsInt(string numberString, int defaultValue) | |
12 { | |
13 int parsedValue = defaultValue; | |
14 int.TryParse(numberString, out parsedValue); | |
15 return parsedValue; | |
16 } | |
17 } | |
18 } |