<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Boolean check for string as Integer</Title>
      <Shortcut>BooleancheckforstringasInteger</Shortcut>
      <Description>Boolean check for string as Integer [C#]</Description>
      <Author>Vidar Markussen</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=e97227e7-778e-4a0a-bc80-760a6ce66452</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[		/// <summary>
		/// Checks a string to see if it could be
		/// parsed as an Integer
		/// </summary>
		/// <param name="sNumber">The string containing the mnumber to be checked</param>
		/// <returns>Boolead True or False if the string could be parsed as a string or not. </returns>		
		public static bool IsInt(string sNumber)
		{
			if(sNumber == null)
				return false;
			
			char[] chars = sNumber.ToCharArray() ;
			for ( int i = 0; i < chars.Length; i++ )
			{
				if( !Char.IsDigit( chars[ i ] ) )
				{
					return false ;
				}
			}
			return true ; 
		}
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>