Strmid

From SA-MP Wiki

Jump to: navigation, search


Extract a range of characters from a string.


Parameters:
(dest[],const source[],start,end,maxlength=sizeof dest)
dest[]The string to store the extracted characters in.
const source[]The string from which to extract characters.
startThe position of the first character.
endThe position of the last character.
maxlength=sizeof destThe length of the destination. (Will be the size of dest by default)


ReturnsThis function doesn't return a specific value


strmid(string, "Extract 'HELLO' without the !!!!: HELLO!!!!", 34, 39); //string contains "HELLO"

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.
  • Strlen: Get the length of the 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