Snippet
Private Function FromBaseToBase(ByRef s As String, ByVal fromBase As Integer, ByVal ToBase As Integer) As String
If (fromBase <> 2) Or (fromBase <>8) or (fromBase<>10) or (fromBase<>16) Then Return ""
If (ToBase<> 2) Or (ToBase<>8) or (ToBase<>10) or (ToBase<>16) Then Return ""
If s.length=0 then return ""
' Convert (Convert to from base) to ToBase
Return Convert.ToString(Convert.ToInt32(s, fromBase), ToBase)
End Function
Copy & Paste
|