Перейти к содержанию

Ui::getTextSubstringSlice

Материал из RAGE MP Wiki Archive
Версия от 14:59, 20 мая 2017; imported>StreetGT
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

Returns a substring that is between two specified positions. The length of the string will be calculated using (endPosition - startPosition).

Example:
// Get 'STRING' text from 'MY_STRING'
subStr = UI::_GET_TEXT_SUBSTRING_SLICE('MY_STRING', 3, 9);
// Overflows are possibly replaced with underscores (needs verification)
subStr = UI::_GET_TEXT_SUBSTRING_SLICE('MY_STRING', 3, 10); // 'STRING_'?

Syntax

<syntaxhighlight lang="javascript">mp.game.ui.getTextSubstringSlice(text, startPosition, endPosition);</syntaxhighlight>

Required Arguments

  • text: String
  • startPosition: int
  • endPosition: int

Return value

  • String

Example

<syntaxhighlight lang="javascript"> // todo </syntaxhighlight>

See also