-
14 pages in this category
-
AddLeadingZeros()
Lua SwxWare v13.10 This helper function takes a string or a number (converts it into a string) and adds leading zeros ("0") until a given length is reached. local sNumber = AddLeadingZeros(szSource, nExpectedNumberLength) This functions returns a string value. Example: local nNumber = 2 local sNumber = AddLeadingZeros(nNumber, 4) PBXScript.OutputTrace("sNumber = " .. sNumber) --> sNumber = 0002 - 489 views
-
IsEmailString()
Lua SwxWare v13.10 This helper function checks, if the given string is an email address. local bEmail = IsEmailString(str) This function returns a boolean value. The check for a valid email email address is quite simple, it will just be checked if there is an "@" character within the given string. Example: local bEMail = IsEmailString("test@test.com") PBXScript.OutputTrace ("bEMail = " ..tostring(bEMail)) --& - 259 views
-
IsInString()
Lua SwxWare v13.10 This helper function checks is a given substring is part of a given string. local bFound = IsInString(str, substr) This function returns a boolean value. Examples: local bFound = IsInString("+494012345", "123") PBXScript.OutputTrace("bFound = " .. tostring(bFound)) --> bFound = true local bFound = IsInString("Erika Mustermann", "Herbert") PBXScript.OutputTrace("bFound = " .. tostring(bFound) - 217 views
-
IsString()
Lua SwxWare v13.10 This helper function checks if the given parameter is of type string. local bString = IsString(str) This function returns a boolean value. Examples: local bString = IsString("I am a string") PBXScript.OutputTrace("bString = " .. tostring(bString)) --> bString = true local bString = IsString(12345) PBXScript.OutputTrace("bString = " .. tostring(bString)) --> bString = false - 309 views
-
StringLeft()
Lua SwxWare v13.10 This helper function returns the given number of characters from the left side of the given string. local sLeft = StringLeft(str, len) This function returns a string value. Examples: local sLeft = StringLeft("Erika Mustermann", 5) PBXScript.OutputTrace("sLeft = " .. sLeft) --> sLeft = Erika local tConfig = nil local sPublicLineAccess = "" tConfig = PBXScript.GetPBXConfig() sPublicLineAccess - 267 views
-
StringLen()
Lua SwxWare v13.10 This helper function returns the length of a given string. local nLength = StringLen(str) This function returns a number value. Examples: local nLength = StringLen("Erika Mustermann") PBXScript.OutputTrace("nLength = " .. tostring(nLength)) --> nLength = 16 local tConfig = nil local sPublicLineAccess = "" tConfig = PBXScript.GetPBXConfig() sPublicLineAccess = tConfig.publicaccessprefix PBXSc - 237 views
-
StringLTrim()
Lua SwxWare v13.10 The helper function removes all space characters from the left from a given string. local sLeft = StringLTrim(str) This function returns a string value. Example: local sLeft = StringLTrim(" Erika Mustermann ") PBXScript.OutputTrace("#" .. sLeft .. "#") --> #Erika Mustermann # - 227 views
-
StringMid()
Lua SwxWare v13.10 This helper function returns a given number of characters from a given position from within a given string. local sMid = StringMid(str, pos, len) This function returns a string value. Example: local sMid = StringMid("Erika Mustermann", 7, 6) PBXScript.OutputTrace("sMid = " .. sMid) --> sMid = Muster - 254 views
-
StringPos()
Lua SwxWare v13.10 This helper function search the first occurance of a substring within a string an returns its position. local nPos = StringPos(str, substr) This function returns a number value. Example: local nPos = StringPos("Erika Mustermann", "Muster") PBXScript.OutputTrace("nPos = " .. tostring(nPos)) --> nPos = 7 - 220 views
-
StringReplace()
Lua SwxWare v13.10 This helper function replaces a given substring within a given string by a replacement substring. local sReplace = StringReplace(str, substr, repl) This function returns a string value. Example: local sReplace = StringReplace("Erika Mustermann", "Muster", "Bau") PBXScript.OutputTrace("sReplace = " .. sReplace) --> sReplace = Erika Baumann - 267 views
-
StringRight()
Lua SwxWare v13.10 This helper function returns the given number of characters from the right side of the given string. local sRight = StringRight(str, len) This function returns a string value. Example: local sRight = StringRight("Erika Mustermann", 4) PBXScript.OutputTrace("sRight = " .. sRight) --> sRight = mann - 253 views
-
StringRTrim()
Lua SwxWare v13.10 The helper function removes all space characters from the right from a given string. local sRight = StringRTrim(str) This function returns a string value. Example: local sRight = StringRTrim(" Erika Mustermann ") PBXScript.OutputTrace("#" .. sRight .. "#") --> # Erika Mustermann# - 223 views
-
StringSplitToTable()
Lua SwxWare v13.10 This helper function splits parts of a given string, separated by a given separator, into a table. local tParts = StringSplitToTable(sInput, sSeperator) This function returns a table of string values. Example: local tParts = StringSplitToTable("111;222;333;444", ";") for i = 1, #tParts do PBXScript.OutputTrace("tParts[" .. tostring(i) .. "] = " .. tParts[i]) end --> tParts[1] = 111 --> tParts[ - 205 views
-
StringTrim()
Lua SwxWare v13.10 The helper function removes all space characters from the left and right from a given string. local sTrim = StringTrim(str) This function returns a string value. Example: local sTrim = StringTrim(" Erika Mustermann ") PBXScript.OutputTrace("#" .. sTrim .. "#") --> #Erika Mustermann# - 221 views
-