Created
September 21, 2012 08:05
-
-
Save hachibeeDI/3760291 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports System.Runtime.CompilerServices | |
''' <summary> エイリアス的な拡張メソッドたち </summary> | |
Module StringExtention | |
''' <summary> </summary> | |
<Extension()> _ | |
Public Function setFormat(this As String, ParamArray values As String()) As String | |
Return String.Format(this, values) | |
End Function | |
<Extension()> _ | |
Public Function toStr_exlusDBNull(this As DataRow, columnname As String) As String | |
If this(columnname) Is DBNull.Value Then Return "" | |
Return this(columnname) | |
End Function | |
<Extension()> _ | |
Public Function isInt(this As String) As Boolean | |
Return Integer.TryParse(this, Nothing) | |
End Function | |
''' <summary> C#のasみたいなもん </summary> | |
<Extension()> _ | |
Public Function asInt(this As String) As Integer | |
If this.isInt Then Return CType(this, Integer) | |
Return 0 | |
End Function | |
''' <summary> </summary> | |
<Extension()> _ | |
Public Function setFormat(this As String, ParamArray values As String()) As String | |
Return String.Format(this, values) | |
End Function | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment