Check For Numeric Characters

Share |

Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Powershell Plus

13 Free SQL Tools from Idera

Free Ebook: Mastering Powershell


Try this if you need to check a single character and find out whether or not it is numeric:

PS > [char]::IsNumber('1')
PS > [char]::IsNumber('A')


The type Char has a bunch of other useful methods. Here is a list that you can try:

[char] | Get-Member -static



Twitter This Tip! ReTweet this Tip!

Posted Jun 21 2011, 08:00 AM by ps1
Copyright 2012 All rights reserved.