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

BinaryFormat.Text

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

Returns a binary format that reads a text value. The optional encoding value specifies the encoding of the text.

BinaryFormat.Text(length as number, optional encoding as nullable number) as function  

Arguments

ArgumentDescription
lengthThe number of bytes to decode.
optional encodingThe encoding of the text.

Remarks

  • If the encoding is not specified, then the encoding is determined from the Unicode byte order marks.

  • If no byte order marks are present, then TextEncoding.Utf8 is used.

Example

// Decode two bytes as ASCII text.  
let  
binaryData = #binary({65, 66, 67}),  
textFormat = BinaryFormat.Text(2, TextEncoding.Ascii)  
in  
textFormat(binaryData)   
equals "AB"  
© 2018 Microsoft