VB.NET校验字符串函数
来源:本站原创|时间:2022-11-25|栏目:vb|
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
以上所述就是本文的全部内容了,希望大家能够喜欢。
您可能感兴趣的文章
- 01-10VBS教程:函数-Mid 函数
- 01-10VBS教程:函数-Len 函数
- 01-10VBS教程:函数-Asc 函数
- 01-10VBS中转换二进制数据为字符串常用办法
- 01-10VB.net常用字符和日期等函数
- 01-10vb.net发布水晶报表程序步骤
- 01-10计算一个字符串在另一字符串中出现的次数函数
- 01-10vb.net验证密码是否复杂的方法
- 01-10vb.net读写文件代码
- 01-10VB.net 查询获取数据库数据信息