| Tony Gong的技术Blog |
|
|||
| 技术旅途中蹒跚的行者 | ||||
|
公告
日历
统计
导航 |
环境:vs2003,vs.net 1
Dim i As Int162 ![]() 3 Dim strA As String4 strA = Nothing5 i = Microsoft.VisualBasic.Len(strA) ‘i为06 i = strA.Length ‘抛出NullReferenceException异常7 ![]()
1
![]() Public Shared Function Len()Function Len(ByVal Expression As String) As Integer2 If (Expression Is Nothing) Then3 Return 04 End If5 Return Expression.Length6 End Function
If strA Is Nothing Then i = 0 Else i = strA.Length End If程序员问答社区,解决您的IT难题
|
![]() |
|
| Copyright © Tony.Gong | Powered by: 博客园 模板提供:沪江博客 |