Public Function StartTableCell( _
Optional ByVal align As String = "", _
Optional ByVal valign As String = "", _
Optional ByVal colspan As String = "", _
Optional ByVal rowspan As String = "", _
Optional ByVal width As String = "", _
Optional ByVal height As String = "") As String
Dim _StrBuil As New StringBuilder()
End Function
如何显示调用者传入值的参数中的值?例如,如果align
为""
则不应显示。
答案 0 :(得分:0)
最简单的方法是检查每个参数并逐个构建StringBuilder
。
例如:
Dim _StrBuil As New StringBuilder()
If Not String.IsNullOrEmpty(align)
_StrBuil.Append(("align: """ + align + """")
End If
If Not String.IsNullOrEmpty(valign)
_StrBuil.Append(("valign: """ + valign + """")
End If
'etc.
Return "<td " + _StrBuil.ToString + ">"