Splits string into array of strings separated by 'sample'.
- Аргументы
-
sample | string Strings separator |
- Возвращает
TStringArray
Array with strings string example = "The quick brown fox jumps over the lazy dog";
example.
Split(
" ", strs);
for (int i = 0; i < strs.Count(); i++)
{
}
>> 'The'
>> 'quick'
>> 'brown'
>> 'fox'
>> 'jumps'
>> 'over'
>> 'the'
>> 'lazy'
>> 'dog'
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
См. определение в файле EnString.c строка 396
397 {
398 int txt_len = 0;
399 int sep_pos = -1;
400 int nxt_sep_pos = 0;
401 string text = "";
402
403 bool line_end = false;
404 while (line_end == false)
405 {
406 sep_pos = sep_pos + txt_len + 1;
407 nxt_sep_pos = value.IndexOfFrom(sep_pos, sample);
408 if ( nxt_sep_pos == -1 )
409 {
410 nxt_sep_pos = value.Length();
411 line_end = true;
412 }
413
414 txt_len = nxt_sep_pos - sep_pos;
415 if ( txt_len > 0 )
416 {
417 text = value.
Substring(sep_pos, txt_len);
419 }
420 }
421 }
proto void Insert(int index, string input)
Inserts a string into the n-th index, increasing the string length by the size of the input.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
Перекрестные ссылки Insert() и Substring().
Используется в JsonObject::AddString(), DisplayActions(), ScriptConsoleConfigTab::FindInHierarchy(), UIPopupScript::FindInHierarchy(), ScriptedWidgetEventHandler::GenerateValidIP(), PluginBase::GetBaseClasses(), PluginBase::GetConfig(), CGame::GetLastVisitedServer(), PluginFileHandler::GetParameterString(), PluginFileHandler::GetSubParameterInArrayString(), ServerBrowserTab::GetTimeOfDayEnum(), ServerBrowserTabConsolePages::LoadExtraEntries(), OnGUI_AnimEvents(), PluginFileHandler::ParseTextToArray(), PluginFileHandler::ParseToValueArray(), PasteValues(), ScriptConsoleItemsTab::PrepareFilters(), ScriptConsoleSoundsTab::PrepareFilters(), DayZPlayer::ProcessAttachmentEvent(), ScriptConsoleConfigTab::RenderVariables(), ScriptedWidgetEventHandler::SetTime(), ScriptedWidgetEventHandler::SetTimeIcon() и PluginBase::SpawnFromClipboard().