Difference between revisions of "Buffer:trim"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Removes data from the head or tail of a '''Buffer''' object.
 
Removes data from the head or tail of a '''Buffer''' object.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(number) = Buffer:trim(amount)
 
(number) = Buffer:trim(amount)
</source>
+
</syntaxhighlight>
 
If ''amount'' is positive, data is removed from the beginning, otherwise data is removed from the end.
 
If ''amount'' is positive, data is removed from the beginning, otherwise data is removed from the end.
  

Latest revision as of 14:27, 13 July 2023

Available since: Gideros 2020.2
Class: Buffer

Description

Removes data from the head or tail of a Buffer object.

(number) = Buffer:trim(amount)

If amount is positive, data is removed from the beginning, otherwise data is removed from the end.

Parameters

amount: (number) amount of data to remove

Return values

Returns (number) new buffer size