Skip to content
Reference > Methods

strEncodeBytes(str)

Definition

Binary strEncodeBytes(String str)

Description

Encodes str using UTF-8 and returns it as a Byte.

Parameter Definition

Name Type Description
str String string to encode

Examples

1
2
3
Binary r1 = strEncodeBytes("Hi this is Jay."); // r1 == 15 bytes
Binary r2 = strEncodeBytes(""); // r2 == 0 bytes
Binary r3 = strEncodeBytes("123"); // r3 == 3 bytes