Table of contents
TOC
Collapse the table of content
Expand the table of content

ExtraTopLevelOperators.sprintf<'T> Function (F#)

Den Delimarsky|Last Updated: 7/5/2016
|
1 Contributor

The sprintf function prints to a string using the given format.

Namespace/Module Path: Microsoft.FSharp.Core.ExtraTopLevelOperators

Assembly: FSharp.Core (in FSharp.Core.dll)

Syntax

// Signature:
sprintf : StringFormat<'T> -> 'T

// Usage:
sprintf format

Parameters

format Type: StringFormat<'T>

Remarks

This function is named PrintFormatToString in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.

Example


    let printToString value =
        sprintf "Formatted string with value %d..." value
    printfn "%s" (printToString 109)
Formatted string with value 109...

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Core.ExtraTopLevelOperators Module (F#)

Microsoft.FSharp.Core Namespace (F#)

© 2016 Microsoft