Dayz  1.11.153731
Dayz Code Explorer by Zeroy
Strings

Data Structures

class  string
 

Functions

bool Contains (string sample)
 Retunrs true if sample is substring of string. More...
 
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. More...
 
string Get (int index)
 Gets n-th character from string. More...
 
proto native int Hash ()
 Returns hash of string. More...
 
proto native int IndexOf (string sample)
 Finds 'sample' in 'str'. More...
 
proto native int IndexOfFrom (int start, string sample)
 Finds 'sample' in 'str' from 'start' position. More...
 
proto native int LastIndexOf (string sample)
 Finds last 'sample' in 'str'. More...
 
proto native int Length ()
 Returns length of string. More...
 
proto native int LengthUtf8 ()
 Returns number of characters in UTF8 string. More...
 
proto int ParseString (out string tokens[])
 Parses string into array of tokens returns number of tokens. More...
 
proto int ParseStringEx (out string token)
 Parses one token from input string. More...
 
proto int Replace (string sample, string replace)
 Replace all occurrances of 'sample' in 'str' by 'replace'. More...
 
void Set (int n, string _value)
 Sets n-th character in string. More...
 
void Split (string sample, out array< string > output)
 Splits string into array of strings separated by 'sample'. More...
 
proto string Substring (int start, int len)
 Substring of 'str' from 'start' position 'len' number of characters. More...
 
string SubstringInverted (string string_to_split, int position_start, int position_end)
 Inverted SubString. This deletes everything in between position_start and position_end. More...
 
proto string SubstringUtf8 (int startChar, int len)
 Substring of 'str' from 'startChar' position 'len' number of characters for UTF8 strings with multibyte chars. More...
 
proto int ToAscii (string str)
 Converts string's first character to ASCII code. More...
 
proto native float ToFloat ()
 Converts string to float. More...
 
proto native int ToInt ()
 Converts string to integer. More...
 
proto int ToLower ()
 Changes string to lowercase. More...
 
static proto string ToString (void var, bool type=false, bool name=false, bool quotes=true)
 Return string representation of variable. More...
 
proto native ToType ()
 Returns internal type representation. More...
 
proto int ToUpper ()
 Changes string to uppercase. More...
 
proto vector ToVector ()
 Returns a vector from a string. More...
 
proto string Trim ()
 Returns trimmed string with removed leading and trailing whitespaces. More...
 
proto int TrimInPlace ()
 Removes leading and trailing whitespaces in string. More...
 

Variables

static const string Empty
 

Detailed Description

Function Documentation

◆ Contains()

◆ Format()

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 
)
staticprivate

Gets n-th character from string.

Parameters
indexcharacter 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'

Referenced by Weapon_Base::AssembleGun(), ConstructionActionData::GetDialNumberText(), QuantityConversions::GetItemQuantityText(), Debug::LogMessage(), Weapon_Base::OnFire(), ScriptedWidgetEventHandler::SetItemDesc(), ScriptedWidgetEventHandler::SetWeaponModeAndZeroing(), and ScriptedWidgetEventHandler::SetWeaponQuantity().

◆ Get()

string Get ( int  index)
inlineprivate

Gets n-th character from string.

Parameters
indexcharacter index
Returns
string character on index-th position in string
string str = "Hello World";
Print( str[4] ); // Print( str.Get(4) );
>> 'o'

Definition at line 406 of file EnString.c.

References string::Substring().

Referenced by HudDebugWinBase::AddValue(), InventoryItem::ChangeIntoOnDetach(), UIPopupScript::ClearHierarchy(), UIScriptedMenu::ClearHierarchy(), CGame::ConfigPathToString(), BuildingSuper::ConvertAttSlotToPlantSlot(), DialNextNumber(), UIPopupScript::ExpandHierarchy(), UIScriptedMenu::ExpandHierarchy(), UIPopupScript::FindInHierarchy(), UIScriptedMenu::FindInHierarchy(), PluginRecipesManagerBase::GenerateHumanReadableRecipeList(), PluginRecipesManagerBase::GenerateRecipeCache(), ScriptedWidgetEventHandler::GenerateValidIP(), PluginBase::GetBaseClassPath(), PluginBase::GetBaseClassPathRecursive(), PluginBase::GetConfig(), PluginBase::GetConfigRecursive(), map< string, ref PlayerListEntryScriptedWidget >::GetDamageZoneMap(), ConstructionActionData::GetDialNumberText(), ScriptedWidgetEventHandler::GetFilterOptionsConsoles(), UIScriptedMenu::GetItemNamesForSlots(), PluginFileHandler::GetLastLine(), CGame::GetModelName(), PluginBase::GetName(), PluginBase::GetNameByID(), PluginFileHandler::GetParameterString(), OptionSelectorBase::GetStringValue(), PluginFileHandler::GetSubParameterInArrayString(), ScriptedWidgetEventHandler::GetValueString(), HandleView(), InitData(), PluginFileHandler::LoadConfigFile(), PluginFileHandler::LoadParameter(), LoadPlayerAttachmentIndexes(), Debug::LogArrayInt(), Debug::LogArrayString(), PluginRecipesManagerBase::MatchItems(), OnDebugSpawn(), OnlineServices::OnFriendsAsync(), OnlineServices::OnPermissionsAsync(), PluginBase::PlayerKilled(), PluginBase::QuickSortPartition(), PluginFileHandler::SaveConfigToFile(), PluginBase::SendRPCMods(), MissionBase::ShowHairDebugValues(), ShuffleLock(), SwitchItemSelectionTexture(), ItemBase::UpdatePhysics(), ItemBase::UpdateVisuals(), and ReplaceItemWithNewLambda::VerifyItemTypeBySlotType().

◆ Hash()

◆ IndexOf()

◆ IndexOfFrom()

proto native int IndexOfFrom ( int  start,
string  sample 
)
private

Finds 'sample' in 'str' from 'start' position.

Returns -1 when not found

Parameters
startint Start from position
samplestring Finding 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
>> -1

Referenced by ActionUnmountBarbedWire::ActionCondition(), PluginBase::GetBaseClassPathCombined(), PluginFileHandler::ParseTextToArray(), PluginFileHandler::ParseToValueArray(), OpenDirPlugin::Run(), and SetMissionPath().

◆ LastIndexOf()

proto native int LastIndexOf ( string  sample)
private

Finds last 'sample' in 'str'.

Returns -1 when not found

Parameters
samplestring Finding string
Returns
int - Returns position where sample starts, or -1 when sample not found
string str = "Hello World";
Print( str.IndexOf( "l" ) );
>> 9

◆ Length()

proto native int Length ( )
private

Returns length of string.

Returns
int - Length of string
string str = "Hello World";
int i = str.Length();
Print(i);
>> i = 11

Referenced by ActionEnterLadder::ActionCondition(), ActionMountBarbedWire::ActionCondition(), ActionUnmountBarbedWire::ActionCondition(), ScriptedWidgetEventHandler::Add(), JsonObject::AddString(), CanReachSeatFromDoors(), UIScriptedMenu::ConnectLastSession(), Consume(), PluginBase::ContainsFirstClass(), AttachmentsOutOfReach::CreateAttachmentPosition(), WrittenNoteData::DepleteWritingImplement(), DialNextNumber(), DropNonUsableMaterialsServer(), FindComponentDirectionOffset(), PluginBase::GetBaseClassPath(), PluginBase::GetConfig(), PluginBase::GetConfigRecursive(), ConstructionActionData::GetDialNumberText(), ScriptedWidgetEventHandler::GetFilterOptionsConsoles(), ScriptedWidgetEventHandler::GetFilterOptionsPC(), FireplaceBase::GetFirePointIndex(), JsonObject::GetJson(), CGame::GetModelName(), ModifierBase::GetName(), PluginBase::GetOnlyChildPath(), BuildingSuper::GetSlotIndexBySelection(), PluginFileHandler::GetTextType(), ScriptedWidgetEventHandler::GetValueString(), MiscGameplayFunctions::InsertAtPos(), ScriptedWidgetEventHandler::IsComponentInSelection(), IsPingInRange(), PluginFileHandler::IsTextArray(), ActionCarDoors::OnEnd(), OnEvent(), OnStepEvent(), PluginFileHandler::ParseText(), PluginFileHandler::ParseTextToArray(), PluginFileHandler::ParseTextToParameter(), PluginFileHandler::ParseToValueArray(), PluginFileHandler::ParseToValueString(), OpenDirPlugin::Run(), MiscGameplayFunctions::SanitizeString(), Hud::SetCursorIcon(), ScriptedWidgetEventHandler::SetItemDesc(), ShuffleLock(), string::SubstringInverted(), ToStringLen(), DebugPrint::TrimDebugLog(), HudDebugWinBase::Update(), and MiscGameplayFunctions::ValueToBar().

◆ LengthUtf8()

proto native int LengthUtf8 ( )
private

Returns number of characters in UTF8 string.

Returns
int - Number of characters in UTF8 string
string str = "こんにちは世界";
int i = str.LengthUtf8();
Print(i);
>> i = 7

Referenced by UIScriptedMenu::Refresh().

◆ ParseString()

proto int ParseString ( out string  tokens[])
private

Parses string into array of tokens returns number of tokens.

Parameters
[out]tokensarray[] 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'

◆ ParseStringEx()

proto int ParseStringEx ( out string  token)
private

Parses 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.

Parameters
[out]tokenstring Founded string token
Returns
int Type of token
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
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'

◆ Replace()

proto int Replace ( string  sample,
string  replace 
)
private

Replace all occurrances of 'sample' in 'str' by 'replace'.

Parameters
samplestring to search in str
replacestring which replace sample in str
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.'

Referenced by PluginFileHandler::AddNewLine(), Icon::Combine(), PluginConfigHandler::DecodeInitScript(), Icon::DoubleClick(), VicinitySlotsContainer::DoubleClick(), PlayerContainer::DoubleClick(), AttachmentCategoriesRow::DoubleClick(), ZombieContainer::DoubleClick(), ClosableContainer::DoubleClick(), HandsContainer::DoubleClick(), Icon::DraggingOver(), DraggingOverCenterPanel(), Icon::DraggingOverCombine(), ContainerWithCargo::DraggingOverGrid(), AttachmentCategoriesRow::DraggingOverGrid(), ClosableContainer::DraggingOverGrid(), HandsContainer::DraggingOverGrid(), HandsArea::DraggingOverHandsPanel(), VicinityContainer::DraggingOverHeader(), ZombieContainer::DraggingOverHeader(), AttachmentCategoriesContainer::DraggingOverHeader(), AttachmentCategoriesRow::DraggingOverHeader(), HandsContainer::DraggingOverHeader(), VicinityContainer::DraggingOverIcon(), Icon::DraggingOverSwap(), Icon::DropReceivedFromMain(), PluginConfigHandler::EncodeInitScript(), PluginFileHandler::GetAllLines(), ContainerWithCargo::GetItemPreviewItem(), HandsContainer::GetItemPreviewItem(), ClosableContainer::GetItemPreviewItem(), AttachmentCategoriesRow::GetItemPreviewItem(), ClosableContainer::GetItemPreviewWidget(), PlayerContainer::GetItemPreviewWidget(), ClosableContainer::GetItemPreviewWidgetDragOrDrop(), LoadPlayerAttachmentIndexes(), VicinitySlotsContainer::MouseButtonDown(), VicinitySlotsContainer::MouseClick(), HandsContainer::MouseClick2(), OnCenterPanelDropReceived(), ZombieContainer::OnDropReceivedFromGhostArea(), ZombieContainer::OnDropReceivedFromHeader(), VicinityContainer::OnDropReceivedFromHeader(), AttachmentCategoriesContainer::OnDropReceivedFromHeader(), VicinitySlotsContainer::OnDropReceivedFromHeader(), VicinityContainer::OnDropReceivedFromIcon(), HandsArea::OnHandsPanelDropReceived(), InventoryGridController::OnItemDraggingOver(), InventoryGridController::OnItemDropReceived(), OnRightPanelDropReceived(), OpenDirPlugin::Run(), SVNDiffPlugin::Run(), SVNBlamePlugin::Run(), SVNShowLogPlugin::Run(), ResavePlugin::RunCommandline(), ColorManager::SetColor(), ItemManager::SetTemperature(), Icon::Swap(), ZombieContainer::ToggleWidget(), and PlayerContainer::ToggleWidget().

◆ Set()

void Set ( int  n,
string  _value 
)
inlineprivate

Sets n-th character in string.

string str = "Hello World";
str[4] = "O";
Print( str );
>> 'HellO World'

Definition at line 421 of file EnString.c.

Referenced by BuildingSuper::GardenBase(), PluginBase::GetConfig(), and PluginBase::QuickSortPartition().

◆ Split()

void Split ( string  sample,
out array< string output 
)
inlineprivate

Splits string into array of strings separated by 'sample'.

Parameters
samplestring Strings separator
Returns
TStringArray Array with strings
EnString.Split( "The quick brown fox jumps over the lazy dog", " ", strs );
for ( int i = 0; i < strs.Count(); i++ )
{
Print( strs.Get(i) );
}
>> 'The'
>> 'quick'
>> 'brown'
>> 'fox'
>> 'jumps'
>> 'over'
>> 'the'
>> 'lazy'
>> 'dog'

Definition at line 368 of file EnString.c.

References string::Substring().

Referenced by JsonObject::AddString(), UIScriptedMenu::ChangeFilter(), UIPopupScript::FindInHierarchy(), UIScriptedMenu::FindInHierarchy(), ScriptedWidgetEventHandler::GenerateValidIP(), PluginBase::GetConfig(), ScriptedWidgetEventHandler::GetFilterOptionsConsoles(), GetLastVisitedServer(), PluginFileHandler::GetParameterString(), PluginFileHandler::GetSubParameterInArrayString(), ServerBrowserTab::GetTimeOfDayEnum(), OnGUI_AnimEvents(), PluginFileHandler::ParseTextToArray(), PluginFileHandler::ParseToValueArray(), ProcessAttachmentEvent(), and ScriptedWidgetEventHandler::SetTime().

◆ Substring()

proto string Substring ( int  start,
int  len 
)
private

Substring of 'str' from 'start' position 'len' number of characters.

Parameters
startPosition in str
lenCount of characters
Returns
string - Substring of str
string str = "Hello World";
string strSub = str.Substring(2, 5);
Print(strSub);
>> strSub = llo W

Referenced by ActionEnterLadder::ActionCondition(), ActionUnmountBarbedWire::ActionCondition(), TentBase::AnimateCamonetByOpeningSelection(), TentBase::AnimateCamonetToggle(), PluginBase::ContainsFirstClass(), AttachmentsOutOfReach::CreateAttachmentPosition(), string::Get(), PluginBase::GetBaseClassPathCombined(), PluginBase::GetConfig(), PluginBase::GetConfigRecursive(), ScriptedWidgetEventHandler::GetFilterOptionsConsoles(), ScriptedWidgetEventHandler::GetFilterOptionsPC(), FireplaceBase::GetFirePointIndex(), Chemlight_ColorBase::GetMaterialForDamageState(), CGame::GetModelName(), PluginBase::GetOnlyChildPath(), PluginBase::GetPlayerPrefix(), PluginConfigHandler::GetSceneList(), BuildingSuper::GetSlotIndexByAttachmentSlot(), BuildingSuper::GetSlotIndexBySelection(), PluginFileHandler::GetTextType(), ScriptedWidgetEventHandler::GetValueString(), TentBase::HandleCamoNetAttachment(), MiscGameplayFunctions::InsertAtPos(), IsPingInRange(), PluginFileHandler::IsTextArray(), PluginFileHandler::ParseText(), PluginFileHandler::ParseTextToArray(), PluginFileHandler::ParseTextToParameter(), PluginFileHandler::ParseToValueArray(), PluginFileHandler::ParseToValueString(), OpenDirPlugin::Run(), MiscGameplayFunctions::SanitizeString(), SetMissionPath(), string::Split(), string::SubstringInverted(), DebugPrint::TrimDebugLog(), and HudDebugWinBase::Update().

◆ SubstringInverted()

string SubstringInverted ( string  string_to_split,
int  position_start,
int  position_end 
)
inlineprivate

Inverted SubString. This deletes everything in between position_start and position_end.

Definition at line 89 of file EnString.c.

References string::Length(), and string::Substring().

Referenced by ModifierBase::GetName().

◆ SubstringUtf8()

proto string SubstringUtf8 ( int  startChar,
int  len 
)
private

Substring of 'str' from 'startChar' position 'len' number of characters for UTF8 strings with multibyte chars.

Parameters
startCharPosition in str.
lenCount of characters
Returns
string - Substring of str with startChar character and len characters
string str = "こんにちは世界";
string strSub = str.SubstringUtf8(2, 4);
Print(strSub);
>> strSub = にちは世

Referenced by UIScriptedMenu::Refresh().

◆ ToAscii()

proto int ToAscii ( string  str)
private

Converts string's first character to ASCII code.

Parameters
strString for convert to ASCII code
Returns
ascii code int.
int ascii = "M".ToAcsii();
Print(ascii);
>> ascii = 77

◆ ToFloat()

◆ ToInt()

◆ ToLower()

proto int ToLower ( )
private

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 = 11

Referenced by BleedingSourcesManagerBase::AttemptAddBleedingSourceBySelection(), CarScript::CanDisplayAttachmentCategory(), BaseBuildingBase::CanDisplayAttachmentCategory(), BaseBuildingBase::CanDisplayAttachmentSlot(), ItemBase::CanToggleAnimations(), UIScriptedMenu::ChangeFilter(), BaseBuildingBase::CheckSlotVerticalDistance(), AttachmentsOutOfReach::CreateAttachmentPosition(), DropNonUsableMaterialsServer(), ItemBase::EEHealthLevelChanged(), BuildingSuper::EEItemDetached(), UIPopupScript::FindInHierarchy(), UIScriptedMenu::FindInHierarchy(), PluginBase::GetConfig(), PluginBase::GetConfigRecursive(), map< string, ref PlayerListEntryScriptedWidget >::GetDamageZoneFromComponentName(), Debug::GetFiltredConfigClasses(), UIScriptedMenu::GetFiltredConfigClasses(), UIScriptedMenu::GetFiltredSceneObjects(), IEntity::GetLODByName(), ScriptedWidgetEventHandler::GetMapName(), LOD::GetSelectionByName(), BuildingSuper::GetSlotIndexBySelection(), GUIAction_SetValue(), TentBase::HandleCamoNetAttachment(), ItemBase::HandleOpeningsPhysics(), ItemBase::HandleOpeningsVisuals(), ItemBase::HideAllAnimationsAndProxyPhysics(), MissionBaseWorld::InitialiseWorldData(), ScriptedWidgetEventHandler::IsComponentInSelection(), CGame::IsKindOf(), CGame::ObjectIsKindOf(), BleedingSourcesManagerBase::RegisterBleedingZone(), ItemBase::ToggleAnimation(), ItemBase::UpdateAllSelections(), and ItemBase::UpdatePhysics().

◆ ToString()

static proto string ToString ( void  var,
bool  type = false,
bool  name = false,
bool  quotes = true 
)
staticprivate

Return string representation of variable.

Referenced by HFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::Abort(), ActionTuneFrequencyOnGround::ActionCondition(), FireplaceBase::CanPlaceFireplaceInSelectedSpot(), CommandHandlerDebug(), EntityLightSource::CreateLight(), DbgShowBoneName(), DialNextNumber(), BuildingSuper::EEItemAttached(), ComponentEnergyManager::Event_OnAwake(), HFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::FindAbortDestinationState(), BuildingSuper::GardenBase(), ScriptedWidgetEventHandler::GenerateValidIP(), EpinephrineMdfr::GetDebugText(), MorphineMdfr::GetDebugText(), PainKillersMdfr::GetDebugText(), CharcoalMdfr::GetDebugText(), ImmunityBoost::GetDebugText(), AntibioticsMdfr::GetDebugText(), PluginBase::GetHitMessage(), QuantityConversions::GetItemQuantityText(), VicinitySlotsContainer::GetItemQuantityText(), GetStrValue(), Hologram::Hologram(), ComponentEnergyManager::IsSelectionAPlug(), PluginFileHandler::LoadConfigFile(), PluginConfigHandler::LoadSceneObjects(), Debug::LogArrayInt(), ActionManagerBase::OnActionEnd(), MissionBase::OnClientDisconnectedEvent(), PluginFileHandler::ParseParam(), PluginBase::PlayerKilled(), PrintElements(), HFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::ProcessAbortEvent(), HFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::ProcessEvent(), PluginConfigHandler::SaveSceneObjects(), PluginConfigHandler::SceneDuplicate(), PluginLocalProfile::SceneSave(), ScriptedWidgetEventHandler::SetItemQuantity(), PluginFileHandler::SetParameterInt(), UIScriptedMenu::SetServerInfo(), SetupAction(), ScriptedWidgetEventHandler::SetWeaponQuantity(), ShuffleLock(), OFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::Start(), FSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::Start(), HFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::Start(), HFSMBase< Class FSMStateBase, Class FSMEventBase, Class FSMActionBase, Class FSMGuardBase >::Terminate(), PluginDayzPlayerDebug_Weapons::Tick(), ToStringLen(), ServerBrowserTab::UpdatePageButtons(), UpdatePlayerStatus(), and ComponentEnergyManager::UpdateSelections().

◆ ToType()

proto native ToType ( )
private

Returns internal type representation.

Can be used in runtime, or cached in variables and used for faster inheritance checking

Returns
typename Type of class
???

Referenced by ComponentsBank::CreateComponent(), BleedingSource::CreateParticle(), EEHitBy(), EvaluateImpactEffect(), PluginBase::GetModuleType(), IEntity::OnExplodeClient(), PluginBase::OnKeyPress(), PluginBase::OnMouse(), PluginManager::RegisterPlugin(), RegisterSurface(), and PluginManager::UnregisterPlugin().

◆ ToUpper()

proto int ToUpper ( )
private

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 = 11

Referenced by ScriptedWidgetEventHandler::Add(), HandsPreview::CreateNewIcon(), ClosableContainer::SetEntity(), ScriptedWidgetEventHandler::SetItemDesc(), Header::SetName(), ClosableHeader::SetName(), and Container::UpdateHeaderText().

◆ ToVector()

proto vector ToVector ( )
private

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>

Referenced by SceneObject::SetPositionAsString().

◆ Trim()

proto string Trim ( )
private

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'

Referenced by PluginBase::GetOnlyChildPath(), PluginFileHandler::ParseText(), and PluginFileHandler::ParseTextToParameter().

◆ TrimInPlace()

proto int TrimInPlace ( )
private

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 = 11

Referenced by ScriptedWidgetEventHandler::GetValueString().

Variable Documentation

◆ Empty

string::Substring
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
TStringArray
array< string > TStringArray
Definition: EnScript.c:601
Print
proto void Print(void var)
Prints content of variable to console/log.
string::SubstringUtf8
proto string SubstringUtf8(int startChar, int len)
Substring of 'str' from 'startChar' position 'len' number of characters for UTF8 strings with multiby...
string::ToFloat
proto native float ToFloat()
Converts string to float.
vector
Definition: EnConvert.c:95
string::Hash
proto native int Hash()
Returns hash of string.
string::ParseString
proto int ParseString(out string tokens[])
Parses string into array of tokens returns number of tokens.
string::ToVector
proto vector ToVector()
Returns a vector from a string.
string::Replace
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
string::Trim
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
string::IndexOfFrom
proto native int IndexOfFrom(int start, string sample)
Finds 'sample' in 'str' from 'start' position.
WORLD
@ WORLD
Definition: EnWorld.c:168
string::Format
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.
string::ToInt
proto native int ToInt()
Converts string to integer.
string::TrimInPlace
proto int TrimInPlace()
Removes leading and trailing whitespaces in string.
string::ToLower
proto int ToLower()
Changes string to lowercase.
string::Length
proto native int Length()
Returns length of string.
string::IndexOf
proto native int IndexOf(string sample)
Finds 'sample' in 'str'.
string::ToUpper
proto int ToUpper()
Changes string to uppercase.
string::LengthUtf8
proto native int LengthUtf8()
Returns number of characters in UTF8 string.
string::ParseStringEx
proto int ParseStringEx(out string token)
Parses one token from input string.