string_set_byte_at

Set a byte in a string.

Syntax:

GML Code Example

string_set_byte_at(str, pos, byte);


Argument Description
str The string to change the byte of.
pos The position within the string (starting at 1) to change the byte of.
byte The new byte value.


Returns:string


Description

This function sets a byte directly in a string (based on the UTF8 format) and returns a copy of the string with the changes.

NOTE: This function is incredibly slow so consider carefully whether it is necessary and where you use it.


Example:

GML Code Example

str = string_set_byte_at("hello", 2, 97);

The above code would change the byte value of the second letter in the string, and so set the variable "str" to hold "hallo".


Back: Strings



No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here