GetSingleChar

From SA-MP Wiki

Jump to: navigation, search


GetSingleChar

Description:

Returns a single character from a string. This functions is useful, because the command string[2] don't returns the third character of string, but all characters right of the third character.


Parameters:
(const source[], num)
const source[]The string from which to extract the character
numThe position of the character (starts with 0)


Return Values:

A single character from source


new string[MAX_STRING];
format(string,sizeof(string),GetSingleChar("get the big Letter", 12)); // string = "L"


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
  • left: Extract all characters from a string, which are left of a character
  • right: Extract all characters from a string, which are right of a character
  • strmid: Extract a range of characters from a string
Personal tools