Пользовательские дополнения

На главную


common.TruncateWString( str, maxOverallLen, trailingDotsCount, needTrim )

Обрезает строку до указанной длины, добавляя многоточие в конец (опционально).

-- библиотека:
сommon

-- объявление:
function TruncateWString( str, maxOverallLen, trailingDotsCount, needTrim )

-- параметры:
str: WString - исходная строка
maxOverallLen: Int - максимальная длина результирующей строки
trailingDotsCount: Int - количество точек, добавляемых в конец результирующей строки в случае, если длина str превышает maxOverallLen
needTrim: Bool - произвести операцию trim (удалить пробелы и табуляции с обоих концов строки) после обрезания str и до добавления точек

-- возвращаемые значения:
WString - результирующая строка

-- примеры:
local result = common.TruncateWString( src, 20, 3, false )

Search: "CategoryLuaApi" "CategoryCommon"

CategoryCommon
EnumGoalState
EventAddonLoadStateChanged
EventAllodsGoalAdded
EventAllodsGoalChanged
EventAllodsGoalCompleted
EventUserScreenshot
FunctionCommonAddonCreateChildForm
FunctionCommonCreateValuedObject
FunctionCommonCreateValuedText
FunctionCommonEnableUIRender
FunctionCommonExtractWStringFromValuedText
FunctionCommonFormatFloat
FunctionCommonFormatInt
FunctionCommonGetAddonInfo
FunctionCommonGetAddonMainForm
FunctionCommonGetAddonName
FunctionCommonGetAllodsGoals
FunctionCommonGetAllodsGoalsOnLoadingScreen
FunctionCommonGetApiType
FunctionCommonGetBitAnd
FunctionCommonGetBitOr
FunctionCommonGetBitXor
FunctionCommonGetCredits
FunctionCommonGetCSSList
FunctionCommonGetDateTimeFromMs
FunctionCommonGetEmptyWstring
FunctionCommonGetInstanceIdByInteger
FunctionCommonGetIntFromWString
FunctionCommonGetLocalDateTime
FunctionCommonGetLocalization
FunctionCommonGetMsFromDateTime
FunctionCommonGetRandFloat
FunctionCommonGetRandInt
FunctionCommonGetScriptCfgVar
FunctionCommonGetStateManagedAddons
FunctionCommonGetStateName
FunctionCommonGetTerritoryInfo
FunctionCommonGetTexturePath
FunctionCommonIsCapsLockEnabled
FunctionCommonIsEmptyValuedObject
FunctionCommonIsEmptyWstring
FunctionCommonIsKeyEnabled
FunctionCommonIsOnPayToPlayShard
FunctionCommonIsSubstring
FunctionCommonIsSubstringEx
FunctionCommonIsTextFiltered
FunctionCommonIsUIRenderEnabled
FunctionCommonIsValuedObject
FunctionCommonIsValuedText
FunctionCommonIsWString
FunctionCommonLogError
FunctionCommonLogInfo
FunctionCommonLogWarning
FunctionCommonMakeUserAddonFullName
FunctionCommonMakeUserScreenshot
FunctionCommonOnEvent
FunctionCommonOnReaction
FunctionCommonQuitGame
FunctionCommonRegisterEventHandler
FunctionCommonRegisterReactionHandler
FunctionCommonRequestIntegerByInstanceId
FunctionCommonSetCursor
FunctionCommonSetTextValues
FunctionCommonStateLoadManagedAddon
FunctionCommonStateLoadManagedAddonGroup
FunctionCommonStateUnloadManagedAddon
FunctionCommonStateUnloadManagedAddonGroup
FunctionCommonUnRegisterEvent
FunctionCommonUnRegisterEventHandler
FunctionCommonUnRegisterReactionHandler
FunctionCompareWString
FunctionCompareWStringEx
FunctionEscapeWString
FunctionGetWStringLength
FunctionGlobal
FunctionTruncateWString
GoalId


CategoryLuaApi CategoryFunction CategoryCommon

На главную