Strlen

From SA-MP Wiki

Jump to: navigation, search

Strlen


This function can be used to check the length of a specific string.


Parameters:
(const string[])
const string[]The string you want to know the length of.


ReturnsThe length as an integer value.


new stringLength = strlen("This is an example string."); // stringLength is now set to 26


Related Functions

The following functions might be useful as well, as they're 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.
  • strmid: Extract characters from a string.
  • strpack: Pack a string into a destination.
  • strval: Find the value of a string.
  • strcat: Contact two strings into a destination reference.
Personal tools