Strlen

From SA-MP Wiki

Jump to: navigation, search


Get the length of a specific string.


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


ReturnsThe length of the string as an integer.


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


Related Functions

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

  • Strcmp: Compare two strings to check if they are the same.
  • Strfind: Search for a string in a string.
  • Strtok: Get the next word/parameter in a string.
  • Strdel: Delete part of a string.
  • Strins: Insert text into a string.
  • Strmid: Extract part of a string into another string.
  • Strpack: Pack a string into a destination.
  • Strval: Convert a string into an integer.
  • Strcat: Concatenate two strings into a destination reference.
Personal tools