The Lab
HUD native

GET_LENGTH_OF_LITERAL_STRING_IN_BYTES

returns int1 parambuild 1207

Returns the size of string in bytes, which can differ from the character count for multibyte text.

Signature

C
int GET_LENGTH_OF_LITERAL_STRING_IN_BYTES(const char* string); // 0xDC5AD6B7AB8184F5 b1207

Parameters

#NameType
1stringconst char*

Facts

Facts about GET_LENGTH_OF_LITERAL_STRING_IN_BYTES
Name
GET_LENGTH_OF_LITERAL_STRING_IN_BYTES
Hash
0xDC5AD6B7AB8184F5
Namespace
Returns
int
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result = Citizen.InvokeNative(0xDC5AD6B7AB8184F5, -- GET_LENGTH_OF_LITERAL_STRING_IN_BYTES
  "text", -- const char* string
  Citizen.ResultAsInteger()
)
print(result)
JavaScript
const result = Citizen.invokeNative("0xDC5AD6B7AB8184F5", // GET_LENGTH_OF_LITERAL_STRING_IN_BYTES
  "text", // const char* string
  Citizen.resultAsInteger()
);
console.log(result)
C#
int result = Function.Call<int>((Hash)0xDC5AD6B7AB8184F5, // GET_LENGTH_OF_LITERAL_STRING_IN_BYTES
  "text" // const char* string
);
All HUD natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.