VB.NET校驗字符串函數。本站提示廣大學習愛好者:(VB.NET校驗字符串函數)文章只能為提供參考,不一定能成為您想要的結果。以下是VB.NET校驗字符串函數正文
VB.NET校驗字符串能否是日期
'Validate for a date Shared Function checkdate(ByVal thisvalue As String) As String If Not IsDate(thisvalue) Then checkdate = "NULL" Else checkdate = "'" & thisvalue & "'" End If Return checkdate End Function ' END checkdate
VB.NET反省字符串能否是數字
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'Used to submit values to the database, check for empty value, replace w/ "NULL" '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shared Function checkNumber(ByVal thisvalue As String) As String If IsDBNull(thisvalue) Or Len(thisvalue) = 0 Or Not IsNumeric(thisvalue) Then checkNumber = "NULL" Else checkNumber = thisvalue End If Return checkNumber End Function ' END checkNumber
以上所述就是本文的全部內容了,希望大家可以喜歡。