Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function ToString( _ ByVal value As Object _ ) As String |
Parameters
- value
Library/Library.Test/TestStringUtils.cs
C# | Copy Code |
---|---|
Assert.AreEqual("5.1", StringUtils.ToString<double>(5.1)); Assert.AreEqual("5.1", StringUtils.ToString((object)new Version(5, 1))); int ival; object oval; Assert.IsTrue(StringUtils.TryParse("1", out ival)); Assert.AreEqual(1, ival); Assert.IsTrue(StringUtils.TryParse("1", typeof(int), out oval)); Assert.AreEqual(1, oval); |
VB.NET | Copy Code |
---|---|
Assert.AreEqual("5.1", StringUtils.ToString(Of Double)(5.1)) Assert.AreEqual("5.1", StringUtils.ToString(DirectCast(New Version(5, 1), Object))) Dim ival As Integer Dim oval As Object Assert.IsTrue(StringUtils.TryParse("1", ival)) Assert.AreEqual(1, ival) Assert.IsTrue(StringUtils.TryParse("1", GetType(Integer), oval)) Assert.AreEqual(1, oval) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
StringUtils ClassStringUtils Members
Overload List