Difference between revisions of "Buffer:trim"

From GiderosMobile
(Created page with "'''Available since:''' Gideros 2020.2<br/> '''Class:''' Buffer<br/> === Description === Removes data from the head or tail of a Buffer objec...")
 
Line 3: Line 3:
  
 
=== Description ===
 
=== Description ===
Removes data from the head or tail of a [[Special:MyLanguage/Buffer|Buffer]] object.
+
Removes data from the head or tail of a '''Buffer''' object.
If amount is positive, data is removed from the beginning, otherwise data is removed from the end.
 
 
<source lang="lua">
 
<source lang="lua">
 
(number) = Buffer:trim(amount)
 
(number) = Buffer:trim(amount)
 
</source>
 
</source>
 +
If ''amount'' is positive, data is removed from the beginning, otherwise data is removed from the end.
  
 
=== Parameters ===
 
=== Parameters ===
'''amount''': (number) Amount of data to remove.
+
'''amount''': (number) amount of data to remove<br/>
  
 
=== Return values ===
 
=== Return values ===
'''Returns''' (number) New buffer size.<br/>
+
'''Returns''' (number) new buffer size<br/>
  
 
{{Buffer}}
 
{{Buffer}}

Revision as of 02:00, 23 March 2022

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