Buffer.fromstring

From GiderosMobile

Available since: Gideros 2025.1
Class: buffer_luau

Description

Creates a buffer initialized to the contents of the string. The size of the buffer equals the length of the string.

(buffer) = buffer.fromstring(str)

Parameters

str: (string) a string which length sets the size of the buffer

Return values

Returns (buffer) the created buffer

Example

local str = "Hello Gideros!"
local b = buffer.fromstring(str)
print(buffer.len(b))