Difference between revisions of "Buffer.fromstring"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2025.1<br/> '''Class:''' buffer_luau<br/> === Description === Creates a buffer initialized to the contents of the string. The siz...")
 
(No difference)

Latest revision as of 02:39, 6 February 2025

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))