Difference between revisions of "Data:getString"

m
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{newin|[[0.9.0]]|090|type=function}}
 
{{newin|[[0.9.0]]|090|type=function}}
  
Gets the full Data as a string.
+
Gets the full Data as a [[String|string]].
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
data = Data:getString( )
+
data = Data:getString( offset, size )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
None.
+
{{New feature|12.0|
 +
{{param|number|offset (0)|Optional byte offset into the Data's memory to copy from.}}
 +
{{param|number|size (Data:getSize())|Optionally limit the copied string to the specified number of bytes.}}
 +
|120}}
 
=== Returns ===
 
=== Returns ===
 
{{param|string|data|The raw data.}}
 
{{param|string|data|The raw data.}}

Latest revision as of 16:12, 13 April 2024

Available since LÖVE 0.9.0
This function is not supported in earlier versions.


Gets the full Data as a string.

Function

Synopsis

data = Data:getString( offset, size )

Arguments

Available since LÖVE 12.0
number offset (0)
Optional byte offset into the Data's memory to copy from.
number size (Data:getSize())
Optionally limit the copied string to the specified number of bytes.

Returns

string data
The raw data.

See Also

Other Languages