class stringSource
ResourceName › string
Part of Strings
Constants 1
static const string EmptyMethods 32
proto native int ToInt()Converts string to integer
Returns: int - Converted string.
string str = "56";
int i = str.ToInt();
Print(i);
>> i = 56proto native int HexToInt()Converts string to integer
Returns: int - Converted string.
string str = "0xFF";
int i = str.HexToInt();
Print(i);
>> i = 255proto native float ToFloat()Converts string to float
Returns: float - Converted string in float.
string str = "56.6";
float f = str.ToFloat();
Print(f);
>> f = 56.6Show 36 more
, CTKeyframe.GetDOF(), CTKeyframe.GetFOV(), CTKeyframe.GetInterpTime(), DayZProfilesOptions.RegisterProfileOptionFloat(), DayZProfilesOptions.ResetOptionsFloat(), HudDebugWinCharStats.OnChange(), HudDebugWinHorticulture.OnClick(), Liquid.SetUpNutritionalProfile(), OptionSelectorSlider.OnChange(), PluginConfigHandler.ParseToValueFloat(), PluginDayZCreatureAIDebug.GUIAction_SetValue(), PluginDayZCreatureAIDebug.OnGUI_CommandsEdit(), PluginDayZInfectedDebug.CommandHandler(), PluginDayzPlayerDebug_Ctrl.CommandHandler(), PluginDayzPlayerDebug_Weapons.WeaponsStartAction(), PluginDiagMenu.InitTimeAccel(), PluginLocalProfile.GetParameterFloat(), PluginUniversalTemperatureSourceClient.CalcTemperatureFromTemperatureSource(), PluginUniversalTemperatureSourceClient.DrawDebugs(), PluginUniversalTemperatureSourceClient.ProcessUniversalTemperatureSources(), SceneEditorMenu.OnChange(), SceneEditorMenu.OnClick(), SceneEditorMenu.SaveProfileSpawnDistance(), ScriptConsoleCameraTab.IsValidEditboxValue(), ScriptConsoleCameraTab.UpdateValuesFromEditMode(), ScriptConsoleGeneralTab.TextToNumbersArray(), ScriptConsoleItemsTab.~ScriptConsoleItemsTab(), ScriptConsoleItemsTab.OnChange(), ScriptConsoleItemsTab.OnClick(), ScriptConsoleItemsTab.OnDoubleClick(), ScriptConsoleItemsTab.SaveProfileSpawnDistance(), ScriptConsoleVicinityTab.OnChange(), ScriptConsoleVicinityTab.RenderList(), ScriptConsoleWeatherTab.SaveWeatherPreset(), ScriptConsoleWeatherTab.UpdateSliderValues(), and UIPopupScriptPositionManager.OnClick()proto vector ToVector()Returns a vector from a string
Returns: vector Converted s as vector
string str = "1 0 1";
vector v = str.ToVector();
Print(v);
>> v = <1,0,1>Show 11 more
, PluginConfigDebugProfile.GetItemDebugPos(), PluginConfigDebugProfile.GetLocationsData(), PluginConfigScene.LoadSceneObjects(), PluginConfigScene.LoadScenePlayer(), PluginUniversalTemperatureSourceClient.CalcTemperatureFromTemperatureSource(), PluginUniversalTemperatureSourceClient.DrawDebugs(), PluginUniversalTemperatureSourceClient.ProcessUniversalTemperatureSources(), PluginUniversalTemperatureSourceClient.UpdateStatWidget(), PluginUniversalTemperatureSourceClient.UpdateStatWidgets(), SceneObject.SetPositionAsString(), and BeautifiedToVector()vector BeautifiedToVector()Convert beautified string into a vector
vecbeautifiedstring
Returns: vector resulting vector
proto native int ToAscii()Converts string's first character to ASCII code
str- String for convert to ASCII code
Returns: ascii code int.
int ascii = "M".ToAscii();
Print(ascii);
>> ascii = 77proto native typename ToType()Returns internal type representation. Can be used in runtime, or cached in variables and used for faster inheritance checking
Returns: typename Type of class
???Show 15 more
, ComponentsBank.CreateComponent(), EffectArea.GetRequesterIndex(), EntityAI.AttemptDestructionBehaviour(), ImpactMaterials.EvaluateImpactEffect(), ImpactMaterials.RegisterSurface(), InfectedSoundEventHandler.PlayRequest(), PlayerSoundEventHandler.PlayRequestEx(), PluginBase.GetModuleType(), PluginDeveloper.HandlePresetSpawn(), PluginKeyBinding.OnKeyPress(), PluginKeyBinding.OnMouse(), PluginManager.RegisterPlugin(), PluginManager.UnregisterPlugin(), ReplaceSoundEventHandler.PlayReplaceSound(), and SymptomManager.SpawnSymptom()Return string representation of variable
Substring of 'str' from 'start' position 'len' number of characters
start- Position in
str len- Count of characters
Returns: string - Substring of str
string str = "Hello World";
string strSub = str.Substring(2, 5);
Print(strSub);
>> strSub = llo WShow 46 more
, AttachmentsOutOfReach.CreateAttachmentPosition(), Barrel_ColorBase.BleachClothes(), Barrel_ColorBase.ColourClothes(), CameraToolsMenu.OnClick(), CGame.GetModelName(), Chat.Add(), Chemlight_ColorBase.GetMaterialForDamageState(), DayZGame.SetMissionPath(), DayZTool.RunDayZBat(), DebugPrint.TrimDebugLog(), FireplaceIndoor.GetFirePointIndex(), GardenBase.GetSlotIndexByAttachmentSlot(), GardenBase.GetSlotIndexBySelection(), HudDebugWinCharDebug.Update(), MainMenuStats.GetValueString(), MiscGameplayFunctions.InsertAtPos(), MiscGameplayFunctions.SanitizeString(), OpenDirPlugin.Run(), OvenIndoor.GetFirePointIndex(), ParticleList.RegisterParticleByFullPath(), PartyTent.AnimateCamonetByOpeningSelection(), PartyTent.AnimateCamonetToggle(), PartyTent.HandleCamoNetAttachment(), PluginAdminLog.GetPlayerPrefix(), PluginConfigHandler.GetTextType(), PluginConfigHandler.ParseText(), PluginConfigHandler.ParseToValueArray(), PluginConfigHandler.ParseToValueString(), PluginConfigScene.GetSceneList(), PluginConfigViewer.ContainsFirstClass(), PluginConfigViewer.GetBaseClassPathCombined(), PluginConfigViewer.GetConfig(), PluginConfigViewer.GetConfigRecursive(), PluginConfigViewer.GetOnlyChildPath(), PluginLocalProfile.IsTextArray(), PluginLocalProfile.ParseTextToArray(), PluginLocalProfile.ParseTextToParameter(), ScriptConsoleConfigTab.OnClick(), ScriptConsoleGeneralTab.TextToNumbersArray(), ScriptConsoleItemsTab.PrepareFilters(), ServerBrowserFilterContainer.GetFilterOptionsPC(), ServerBrowserFilterContainer.LimitTextBoxCharacterCount(), ServerBrowserTab.IsPingInRange(), OldSet(), Split(), and SubstringInverted()Inverted SubString. This deletes everything in between position_start and position_end.
Substring of 'str' from 'startChar' position 'len' number of characters for UTF8 strings with multibyte chars
startChar- Position in
str. len- Count of characters
Returns: string - Substring of str with startChar character and len characters
string str = "こんにちは世界";
string strSub = str.SubstringUtf8(2, 4);
Print(strSub);
>> strSub = にちは世Replace all occurrances of 'sample' in 'str' by 'replace'
sample- string to search in
str replace- string which replace
sampleinstr
Returns: int - number of occurrances of 'sample' in 'str'
string test = "If the length of the C string in source is less than num, only the content up to the terminating null-character is copied.";
Print(test);
int count = test.Replace("the", "*");
Print(count);
Print(test);
>> string test = 'If the length of the C string in source is less than num, only the content up to the terminating null-character is copied.';
>> int count = 4
>> string test = 'If * length of * C string in source is less than num, only * content up to * terminating null-character is copied.'proto int ToLower()Changes string to lowercase. Returns length
Returns: int - Length of changed string
string str = "Hello World";
int i = str.ToLower();
Print(str);
Print(i);
>> str = hello world
>> i = 11proto int ToUpper()Changes string to uppercase. Returns length
Returns: int - Length of changed string
string str = "Hello World";
int i = str.ToUpper();
Print(str);
Print(i);
>> str = HELLO WORLD
>> i = 11proto native int Length()Returns length of string
Returns: int - Length of string
string str = "Hello World";
int i = str.Length();
Print(i);
>> i = 11proto native int LengthUtf8()Returns number of characters in UTF8 string
Returns: int - Number of characters in UTF8 string
string str = "こんにちは世界";
int i = str.LengthUtf8();
Print(i);
>> i = 7proto native int Hash()Returns hash of string
Returns: int - Hash of string
string str = "Hello World";
int hash = str.Hash();
Print(hash);Show 33 more
, AnimSoundLookupTableBank.GetStepTable(), AnimSoundObjectBuilderBank.GetBuilder(), ArrowManagerPlayer.AddArrowTypeToHash(), ArrowManagerPlayer.Save(), CatchingContextBase.SetupProbabilityArray(), CatchYieldBank.RegisterYieldItem(), CatchYieldBank.UnregisterYieldItem(), CrashBase.RequestSoundEvent(), CrashSoundSets.RegisterSoundSet(), DamageSystem.GetDamageDisplayName(), DayZCreatureAI.ProcessStepEvent(), DayZPlayerImplement.DayZPlayerImplement(), DayZPlayerImplement.OnStepEvent(), DayZPlayerImplement.ProcessVoiceEvent(), DayZPlayerTypeAttachmentSoundLookupTableImpl.DayZPlayerTypeAttachmentSoundLookupTableImpl(), DayZPlayerTypeStepSoundLookupTableImpl.DayZPlayerTypeStepSoundLookupTableImpl(), DayZPlayerTypeVoiceSoundLookupTableImpl.DayZPlayerTypeVoiceSoundLookupTableImpl(), EasterEgg.Capture(), EasterEgg.RegisterSoundSetMap(), EntityAI.InitDamageZoneDisplayNameMapping(), FoodStage.CanTransitionToFoodStageType(), FoodStage.FoodStage(), FoodStage.GetAllCookingPropertiesForStage(), FoodStage.GetCookingPropertyFromIndex(), FoodStage.GetNextFoodStageType(), FoodStage.GetNutritionPropertyFromIndex(), FoodStage.SetupFoodStageMapping(), FoodStage.SetupFoodStageTransitionMapping(), FoodStage.UpdateVisualsEx(), InventoryItem.ProcessImpactSoundEx(), PlayerStomach.RegisterItem(), ScriptConsole.GetWidgetCombinedHash(), and SoundLookupTable.LoadTable()Finds 'sample' in 'str'. Returns -1 when not found
samplestringFinding string
Returns: int - Returns position where sample starts, or -1 when sample not found
string str = "Hello World";
Print( str.IndexOf( "H" ) );
Print( str.IndexOf( "W" ) );
Print( str.IndexOf( "Q" ) );
>> 0
>> 6
>> -1Show 24 more
, CameraToolsMenu.OnClick(), Chemlight_ColorBase.GetMaterialForDamageState(), DayZTool.RunDayZBat(), DebugPrint.IsDebugLog(), DebugPrint.IsStackTrace(), DebugPrint.TrimDebugLog(), DebugPrint.TrimStackTrace(), GardenBase.GetSlotIndexBySelection(), MainMenuStats.GetValueString(), OpenDirPlugin.Run(), PluginAdminLog.GetPlayerPrefix(), PluginConfigHandler.GetTextType(), PluginConfigHandler.ParseParam(), PluginConfigHandler.ParseText(), PluginConfigScene.GetSceneList(), PluginConfigViewer.ContainsFirstClass(), PluginConfigViewer.GetConfig(), PluginLocalProfile.ParseTextToArray(), PluginLocalProfile.ParseTextToParameter(), ScriptConsoleConfigTab.OnClick(), ScriptConsoleItemsTab.PrepareFilters(), ServerBrowserHelperFunctions.GetMapDisplayName(), ServerBrowserTab.PassLocalFilters(), and Contains()Finds last 'sample' in 'str'. Returns -1 when not found
samplestringFinding string
Returns: int - Returns position where sample starts, or -1 when sample not found
string str = "Hello World";
Print( str.IndexOf( "l" ) );
>> 9Finds 'sample' in 'str' from 'start' position. Returns -1 when not found
startintStart from positionsamplestringFinding string expression
Returns: int - Length of string s
string str = "Hello World";
Print( str.IndexOfFrom( 3, "H" ) );
Print( str.IndexOfFrom( 3, "W" ) );
Print( str.IndexOfFrom( 3, "Q" ) );
>> -1
>> 6
>> -1Returns true if sample is substring of string
samplestringFinding string expression
Returns: bool true if sample is substring of string
string str = "Hello World";
Print( str.IndexOfFrom( 3, "Hello" ) );
Print( str.IndexOfFrom( 3, "Mexico" ) );
>> true
>> falseShow 46 more
, ActionCreateIndoorOven.ActionCondition(), ActionDetachFromTarget_SpecificSlotsCategory.FindSlotIdToDetach(), ActionPlaceFireplaceIndoor.ActionCondition(), ActionPlaceOvenIndoor.ActionCondition(), ActionTargetsCursor.GetOnScreenPosition(), ActionUnlockShippingContainer.TranslateLockSelectionIntoDoorIdx(), AreaDamageComponentRaycasted.GetFallbackHitZone(), AttachmentsOutOfReach.CreateAttachmentPosition(), BaseBuildingBase.EEHealthLevelChanged(), BaseBuildingBase.FullyBuild(), BaseBuildingBase.HandleItemFalling(), CheckLocalisationPlugin.FindTexts(), CivilianSedan.CanDisplayAttachmentCategory(), Construction.DropNonUsableMaterialsServer(), Debug.GetFiltredConfigClasses(), Edible_Base.EEItemLocationChanged(), FireplaceBase.IsEntityOnWaterSurface(), Hatchback_02.CanDisplayAttachmentCategory(), Land_WarheadStorage_PowerStation.OnAnimationPhaseStarted(), ObjectSpawnerHandler.SpawnObject(), ObjectSpawnerHandler.ValidatePath(), Offroad_02.CanDisplayAttachmentCategory(), OffroadHatchback.CanDisplayAttachmentCategory(), PluginConfigHandler.ParseToValueBool(), PluginDayZCreatureAIDebug.GUIAction_SetValue(), PluginDayzPlayerDebug.DisplayActions(), PluginDeveloper.SpawnFromClipboard(), SceneEditorMenu.GetFiltredConfigClasses(), SceneEditorMenu.GetFiltredSceneObjects(), ScriptConsoleConfigTab.FindInHierarchy(), ScriptConsoleConfigTab.RenderVariables(), ScriptConsoleGeneralTab.TextToNumbersArray(), ScriptConsoleItemsTab.ChangeFilter(), ScriptConsoleItemsTab.PreprocessFilterText(), ScriptConsoleSoundsTab.ChangeFilter(), ScriptConsoleSoundsTab.ScriptConsoleSoundsTab(), Sedan_02.CanDisplayAttachmentCategory(), SpookyEventBase.GetMatchingSurfacePos(), StaticGUIUtils.VerifyIconImageString(), TentBase.ToggleAnimation(), TrapBase.GetClosestCarWheel(), UIPopupScriptConfigs.FindInHierarchy(), Watchtower.CanDisplayAttachmentCategory(), Watchtower.CanDisplayAttachmentSlot(), Watchtower.CheckLevelVerticalDistance(), and Watchtower.CheckSlotVerticalDistance()proto string Trim()Returns trimmed string with removed leading and trailing whitespaces
Returns: string - Trimmed string
string str = " Hello World "
Print( str );
Print( str.Trim() );
>> ' Hello World '
>> 'Hello World'Show 10 more
, PluginLocalProfile.ParseTextToParameter(), ScriptConsoleConfigTab.ClearHierarchy(), ScriptConsoleConfigTab.ExpandHierarchy(), ScriptConsoleConfigTab.FindInHierarchy(), ScriptConsoleConfigTab.OnClick(), ScriptConsoleItemsTab.PrepareFilters(), ScriptConsoleSoundsTab.PrepareFilters(), UIPopupScriptConfigs.ClearHierarchy(), UIPopupScriptConfigs.ExpandHierarchy(), and UIPopupScriptConfigs.FindInHierarchy()proto int TrimInPlace()Removes leading and trailing whitespaces in string. Returns length
Returns: int - Count of chars
string str = " Hello World ";
int i = str.TrimInPlace();
Print(str);
Print(i);
>> str = 'Hello World'
>> i = 11Parses one token from input string. Result is put into token string, and type of token is returned. Input string is left-truncated by the resulting token length.
- out
token stringFounded string token
Returns: int Type of token \verbatim Token types: 0 - error, no token 1 - defined token (special characters etc. . / * ) 2 - quoted string. Quotes are removed -> TODO 3 - alphabetic string 4 - number 5 - end of line -> TODO \endverbatim
string input = "Hello*World";
string token1;
string token2;
int result1 = input.ParseStringEx(token1);
int result2 = input.ParseStringEx(token2);
Print( "Token1 = '" + token1 + "' Type = " + result1.ToString() ) );
Print( "Token2 = '" + token2 + "' Type = " + result2.ToString() ) );
>> 'Toke1 = 'Hello' Type = 3'
>> 'Toke1 = '*' Type = 1'Parses string into array of tokens returns number of tokens
- out
tokens array[]Parsed string in array
Returns: int Number of tokens
string token[2];
string str = "Hello World";
int result = str.ParseString(token);
for (int i = 0; i < 2; i++)
{
Print(token[i]);
}
>> 'Hello'
>> 'World'Splits string into array of strings separated by 'sample'
samplestringStrings separator
Returns: TStringArray Array with strings
string example = "The quick brown fox jumps over the lazy dog";
TStringArray strs = new TStringArray;
example.Split(" ", strs);
for (int i = 0; i < strs.Count(); i++)
{
Print(strs.Get(i));
}
>> 'The'
>> 'quick'
>> 'brown'
>> 'fox'
>> 'jumps'
>> 'over'
>> 'the'
>> 'lazy'
>> 'dog'Show 33 more
, GetServersResultRow.GetIP(), InputUtils.GetImagesetAndIconFromInputAction(), ItemManager.DeserializeDefaultHeaderOpenStates(), ItemManager.DeserializeDefaultOpenStates(), JsonObject.AddString(), Land_WarheadStorage_Bunker_Facility.OnSpawnByObjectSpawner(), Land_WarheadStorage_Main.OnSpawnByObjectSpawner(), PluginConfigHandler.ParseToValueArray(), PluginConfigViewer.GetBaseClasses(), PluginConfigViewer.GetConfig(), PluginDayZCreatureAIDebug.OnGUI_AnimEvents(), PluginDayzPlayerDebug.DisplayActions(), PluginDeveloper.SpawnFromClipboard(), PluginDiagMenu.InitTimeAccel(), PluginLocalProfile.GetParameterString(), PluginLocalProfile.GetSubParameterInArrayString(), PluginLocalProfile.ParseTextToArray(), ScriptConsoleConfigTab.FindInHierarchy(), ScriptConsoleConfigTab.OnClick(), ScriptConsoleConfigTab.RenderVariables(), ScriptConsoleItemsTab.PrepareFilters(), ScriptConsoleSoundsTab.PrepareFilters(), ScriptConsoleWeatherTab.PasteValues(), ServerBrowserDetailsContainer.SetTimeIcon(), ServerBrowserEntry.SetTime(), ServerBrowserFavoritesTabConsolePages.LoadExtraEntries(), ServerBrowserFilterContainer.GenerateValidIP(), ServerBrowserMenuNew.AddFavoritesToFilter(), ServerBrowserMenuNew.LoadFavoriteServers(), ServerBrowserTabPc.GetTimeOfDayEnum(), UIPopupScriptConfigs.FindInHierarchy(), UniversalTemperatureSourceDebug.ParseData(), and UniversalTemperatureSourceDebug.ParseKeyPairs()static string Join(string separator, notnull TStringArray tokens)Gets n-th character from string
index- character index
Returns: string character on index-th position in string
string str = "Hello World";
Print( str[4] ); // Print( str.Get(4) );
>> 'o'Show 9 more
, ConstructionActionData.GetDialNumberText(), FireworksLauncherClientEvent.FireworksLauncherClientEvent(), MainMenuStats.GetValueString(), MapNavigationBehaviour.OrderedAltitudeNumbersPosition(), MapNavigationBehaviour.OrderedPositionNumbersFromGridCoords(), OptionSelectorSlider.IsValidEditboxValue(), ScriptConsoleCameraTab.IsValidEditboxValue(), ScriptConsoleGeneralTab.TextToNumbersArray(), and ServerBrowserFilterContainer.ProcessIntoIPAddress()Sets the n-th character in string with the input, replacing previous value
index- index to be replaced
input- single non-terminated character value to replace with
string str = "Hello World";
str[4] = "O";
Print( str );
>> 'HellO World'string str = "Hello World";
str[6] = "Test ";
Print( str );
>> 'Hello Test orld'void OldSet(int n, string _value)DIAG_DEVELOPERDo not use. Re-implemented for verification of new function due to design of previous function allowing for unexpected behavior that modders may depend on.
string str = "Hello World";
str.OldSet(6, "Test ");
Print( str );
>> 'Hello Test orld'See also: string.Set, warnings, for, handling, existing, mods, in, Retail
Inserts a string into the n-th index, increasing the string length by the size of the input
index- index to insert at
input- string value to insert with
string str = "Hello World";
str.Insert(6, "Test ");
Print( str );
>> 'Hello Test World'static proto string Format(string fmt, void param1 = NULL, void param2 = NULL, void param3 = NULL, void param4 = NULL, void param5 = NULL, void param6 = NULL, void param7 = NULL, void param8 = NULL, void param9 = NULL)Gets n-th character from string
index- character index
Returns: string character on index-th position in string
int a = 5;
float b = 5.99;
string c = "beta";
string test = string.Format("Ahoj %1 = %3 , %2", a, b, c);
Print(test);
>> 'Ahoj 5 = 'beta' , 5.99'