VB.NET校驗(yàn)字符串函數(shù)
更新時(shí)間:2015年05月19日 15:07:49 投稿:hebedich
本文給大家分享的是2個(gè)vb.net中驗(yàn)字符串類型的函數(shù),十分的簡單實(shí)用,有需要的小伙伴可以參考下。
VB.NET校驗(yàn)字符串是否是日期
'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檢查字符串是否是數(shù)字
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ '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
以上所述就是本文的全部內(nèi)容了,希望大家能夠喜歡。
您可能感興趣的文章:
相關(guān)文章
vb.net操作注冊(cè)表的方法分析【增加,修改,刪除,查詢】
這篇文章主要介紹了vb.net操作注冊(cè)表的方法,結(jié)合實(shí)例形式分析了vb.net針對(duì)注冊(cè)表的增加,修改,刪除及查詢操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2017-03-03VB.NET實(shí)現(xiàn)的MD5加密算法示例【32位】
這篇文章主要介紹了VB.NET實(shí)現(xiàn)的MD5加密算法,結(jié)合具體實(shí)例形式分析了VB.NET實(shí)現(xiàn)的md5加密算法相關(guān)操作步驟與加密處理技巧,需要的朋友可以參考下2017-03-03VB實(shí)現(xiàn)的遞歸復(fù)制文件和搜索文件的代碼分享
這篇文章主要介紹了VB實(shí)現(xiàn)的遞歸復(fù)制文件和搜索文件的代碼分享,代碼寫的比較簡單,容易看懂,需要的朋友可以參考下2014-07-07