ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
در کد زیر توسط تابع Mid کاراکترها یک به یک در تابع Asc قرار داده شده ، چنانچه جواب تابع Asc غیر کد های اسکی 48 تا 57 ( کد اسکی اعداد ) باشد در NumericString ذخیره میشود .
کدی که از فروم های خارجی استخراج شده
Function NumericString(strInput As String) As String 'Returns a string containing only the numeric characters of the input string Dim i As Integer Dim intAsc As Integer NumericString = "" i = 1 While i <= Len(strInput) intAsc = Asc(Mid(strInput, i, 1)) If (intAsc >= 48 And intAsc <= 57) Then 'character is Numeric NumericString = NumericString + Mid(strInput, i, 1) End If i = i + 1 Wend End Function
=NumericString("ABH234D") will return "ABHD"ASCII control characters non printable :
ASCII code 00 = NULL ( Null character )ASCII code 01 = SOH ( Start of Header )
ASCII code 02 = STX ( Start of Text )
ASCII code 08 = BS ( Backspace )
ASCII code 27 = ESC ( Escape )
ASCII code 28 = FS ( File separator )
ASCII code 127 = DEL ( Delete )