Strpack

From SA-MP Wiki

Jump to: navigation, search

strpack

Image:Farm-Fresh text lowercase.png Note: This function name starts with a lowercase letter.


Description:

Pack a string. Packed strings use 75% less memory.


Parameters:
(dest[],const source[],maxlength=sizeof dest)
dest[]The destination string to save the packed string in, passed by reference.
const source[]The source, original string.
maxlength=sizeof stringThe maximum size to insert.


Return Values:

The number of characters packed.


Example Usage:

new string[32 char];
strpack(string, "Hi, how are you?");

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Any functions here can also be found on the Old scripting functions page.

  • strcmp: Compare two strings to see if they are the same.
  • strfind: Search for a substring in a string.
  • strtok: Search for a variable typed after a space.
  • strdel: Delete part/all of a string.
  • strins: Put a string into another string.
  • strlen: Check the length of a string.
  • strmid: Extract characters from a string.
  • strval: Find the value of a string.
  • strcat: Contact two strings into a destination reference.
Personal tools
Navigation
Toolbox