Loupe - Log - Monitor - Resolve
Gibraltar Namespace / CommonCentralLogic Class / SafeFormat Method
An IFormatProvider (such as a CultureInfo) to use, where applicable. (may be null, indicating the current culture)
The desired format string, as used by string.Format().
An array of args, as used by string.Format() after the format string.

In This Topic
    SafeFormat Method
    In This Topic
    Safely attempt to expand a format string with supplied arguments.
    Syntax
    'Declaration
     
    
    Public Shared Function SafeFormat( _
       ByVal formatProvider As IFormatProvider, _
       ByVal format As String, _
       ByVal ParamArray args() As Object _
    ) As String
    public static string SafeFormat( 
       IFormatProvider formatProvider,
       string format,
       params object[] args
    )

    Parameters

    formatProvider
    An IFormatProvider (such as a CultureInfo) to use, where applicable. (may be null, indicating the current culture)
    format
    The desired format string, as used by string.Format().
    args
    An array of args, as used by string.Format() after the format string.

    Return Value

    The formatted string, or an error string containing best-effort information.
    Remarks
    If the normal call to string.Format() fails, this method does its best to create a string (intended as a log message) error message containing the original format string and a representation of the args supplied, to attempt to preserve meaningful information despite the user's mistake.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also