Left

From SA-MP Wiki

Jump to: navigation, search


left

Description:

Extract all characters from a string, which are left from a position


Parameters:
(const source[], pos)
const source[]The string from which to extract characters
posThe position to get all characters left from (first character is 0)


Return Values:

The left part of the string (without the character at pos)


new string[MAX_STRING];
format(string,sizeof(string),left("Only the first sentence. Second sentence", 23)); // string = "Only the first sentence"
format(string,sizeof(string),left("12:45 o'clock", strfind("12:45 o'clock",":"))); // string = "12"


Related Functions

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

  • firstchars: Extract the first characters from a string
  • lastchars: Extract the last characters from a string
  • right: Extract all characters from a string, which are right from a position
  • strmid: Extract a range of characters from a string
Personal tools
Navigation
Toolbox