Sitecore 5.0 API

MainUtil.GetString Method (Object, String)

NOTE: This method is now obsolete.

Please use StringUtil.GetString


Gets the string value of an object.

[Visual Basic]
Overloads Public Shared Function GetString( _
   ByVal value As Object, _
   ByVal defaultValue As String _
) As String
[C#]
public static string GetString(
   object value,
   string defaultValue
);

Parameters

value
An object.
defaultValue
A default value

Return Value

The string value of the object or the default value if the object is null.

Example

  string s0 = StringUtil.GetString(myObject, "");
  string s1 = StringUtil.GetString(Request.QueryString["id"], "");

See Also

MainUtil Class | Sitecore Namespace | MainUtil.GetString Overload List