Colobot Wiki

Extracts a substring of a given length starting at a given position from a string.


strmid ( string, pos, len );

pos: int[]

The index of the first character that is to be included in the extracted substring.

len: int[]

Number of characters to be extracted.


	string s = strmid("abcdef", 1, 2);  // s is "bc"
	string s = strmid("abcdef", 4, 5);  // s is "ef"
	string s = strmid("abcdef", 9, 2);  // s is ""

See also[]

strlen, strleft, strright, strfind, strval, strupper, strlower

Programming, types and categories.