Visual Basic (Declaration) | |
---|---|
Public Function New() |
C# | |
---|---|
public StringConverter() |
Library/Library.Test/TestStringConvert.cs
C# | Copy Code |
---|---|
DateTime date = new DateTime(2000, 1,2,3,4,5,6); string dt = date.ToString(); StringConverter c = new StringConverter(); Assert.AreNotEqual(dt, c.ToString(date)); c.Add<DateTime>(DateTime.TryParse, delegate(DateTime value) { return value.ToString(); }); Assert.AreEqual(dt, c.ToString(date)); |
VB.NET | Copy Code |
---|---|
Dim [date] As New DateTime(2000, 1, 2, 3, 4, 5, _ 6) Dim dt As String = [date].ToString() Dim c As New StringConverter() Assert.AreNotEqual(dt, c.ToString([date])) c.Add(Of DateTime)(DateTime.TryParse, Function(value As DateTime) Do Return value.ToString() End Function) Assert.AreEqual(dt, c.ToString([date])) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
StringConverter ClassStringConverter Members
Overload List