Ui::getTextSubstringSlice: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Returns a substring that is between two specified positions. The length of the string will be calculated using (endPosition - startPosition).<br><br>Example:<br>// Get 'STRING' text from 'MY_STRING'<br>subStr = UI::_GET_TEXT_SUBSTRING_SLICE('MY_STRING', 3, 9);<br>// Overflows are possibly replaced with underscores (needs verification)<br>subStr = UI::_GET_TEXT_SUBSTRING_SLICE('MY_STRING', 3, 10); // 'STRING_'?
Returns a substring that is between two specified positions. The length of the string will be calculated using (endPosition - startPosition).<br><br>Example:<br>// Get 'STRING' text from 'MY_STRING'<br>subStr = UI::_GET_TEXT_SUBSTRING_SLICE('MY_STRING', 3, 9);<br>// Overflows are possibly replaced with underscores (needs verification)<br>subStr = UI::_GET_TEXT_SUBSTRING_SLICE('MY_STRING', 3, 10); // 'STRING_'?
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">ui.getTextSubstringSlice(text, startPosition, endPosition);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.ui.getTextSubstringSlice(text, startPosition, endPosition);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''text:''' String
*'''text:''' String
Line 10: Line 10:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Ui_function_c}}
{{Ui_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:UI API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 14:59, 20 May 2017

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

mp.game.ui.getTextSubstringSlice(text, startPosition, endPosition);

Required Arguments

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

Return value

  • String

Example

// todo

See also