toUtf8Bytes
Learn about the toUtf8Bytes utils method.
Learn about the toUtf8Bytes
utils method.
Introduction
The toUtf8Bytes
method is used to convert a string to its equivalent UTF-8 encoded byte array representation.
Usage
This method should be used when you want to convert a string to its UTF-8 encoded byte array representation. For example, you can use this method to convert the string 'Hello World'
to its UTF-8 encoded byte array representation.
Here’s a simple code example to demonstrate how to use this method:
Javascript