Lasso Soft Inc. > Home

[ string->asbytes ]

Method

[string->asbytes] converts a string object to a bytes object, and returns the value. The bytes object will contain the unicode characters of the string after conversion into a single-byte character encoding. By default the UTF-8 encoding is used. To specify an encoding, pass the name of the encoding to [string->asbytes(encoding::string)].

  • Syntax
'String Value'->asbytes
'String Value'->asbytes('ISO-8859-1')
'String Value'->asbytes('ASCII')
Examples
  • Beginner

To convert a string object to a bytes object:

Use the [string->asbytes] method. The following example converts the string object 'LassoSoft' to a bytes object, and returns the value.

Code

'LassoSoft'->asbytes

Result

LassoSoft

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft