Boxlang 1.x Stable Released
BoxLang : A Modern Dynamic JVM Language
LogoLogo
APIDocsDownloadTrySourceSupport
  • Introduction
    • Contributing Guide
    • Release History
      • 1.1.0
      • 1.0.1
      • 1.0.0
      • RC Stage
        • 1.0.0-RC.1
        • 1.0.0-RC.2
        • 1.0.0-RC.3
      • Beta Stage
        • 1.0.0-Beta27
        • 1.0.0-Beta26
        • 1.0.0-Beta25
        • 1.0.0-Beta24
        • 1.0.0-Beta23
        • 1.0.0-Beta22
        • 1.0.0-Beta21
        • 1.0.0-Beta20
        • 1.0.0-Beta19
        • 1.0.0-Beta18
        • 1.0.0-Beta17
        • 1.0.0-Beta16
        • 1.0.0-Beta15
        • 1.0.0-Beta14
        • 1.0.0-Beta13
        • 1.0.0-Beta12
        • 1.0.0-Beta11
        • 1.0.0-Beta10
        • 1.0.0-Beta9
        • 1.0.0-Beta8
        • 1.0.0-Beta7
        • 1.0.0-Beta6
        • 1.0.0-Beta5
        • 1.0.0-Beta 4
        • 1.0.0-Beta3
        • 1.0.0-Beta2
    • About This Book
      • Authors
  • Getting Started
    • Overview
      • Multi-Runtime
      • Instructions & Interpreters
      • CommandBox CLI
      • Quick Syntax Guide
        • Differences From CFML
      • Frequently Asked Questions
      • Running ColdFusion/CFML Apps
        • Migrating from Adobe ColdFusion
        • Migrating From Lucee CFML
    • Installation
      • Modules
    • Running BoxLang
      • AWS Lambda
      • CommandBox
      • Chromebooks
      • CLI Scripting
      • Docker
      • JSR-223 Scripting
      • MiniServer
      • Try BoxLang!
    • BoxLang Cloud Servers
      • Microsoft Azure
      • Amazon Web Services
    • IDE & Tooling
      • BoxLang Debugger
        • MiniServer Debugging
        • CommandBox Debugging
      • BoxLang Compiler
      • CFML Feature Audit
      • CFML to BoxLang Transpiler
    • Runtime Configuration
      • Directives
      • Caches
      • Datasources
      • Experimental
      • Executors
      • Logging
      • Modules
      • Security
  • BoxLang Language
    • Program Structure
    • Syntax & Semantics
      • Comments
      • Variables
      • Variable Scopes
      • Operators
      • Null & Nothingness
      • Strings
      • Numbers
      • JSON
      • Arrays
      • Structures
      • Queries
      • Datasources
      • Conditionals
      • Attempts
      • Data Navigators
      • Exception Management
      • Code Locking
      • Closures => Context Aware
      • Lambdas -> Pure Functions
      • Includes
      • Threading
    • Classes & O.O.
      • Properties
      • Functions
      • Static Constructs
      • Final Constructs
      • Abstract Constructs
      • Interfaces
    • Reference
      • API Docs
      • Lexical Elements
        • Scopes and Constants
        • Keywords
        • Operators
        • Literals
        • Comments
        • Tokens
        • Semicolons
        • Identifiers
        • Packages and Imports
        • Java Interoperability
        • Errors
      • Types
        • array
        • class
        • date
        • datetime
        • file
        • numeric
        • query
        • stream
        • string
        • struct
        • xml
      • Built-in Functions
        • array
          • ArrayAppend
          • ArrayAvg
          • ArrayClear
          • ArrayContains
          • ArrayContainsNoCase
          • ArrayDelete
          • ArrayDeleteAt
          • ArrayDeleteNoCase
          • ArrayEach
          • ArrayEvery
          • ArrayFilter
          • ArrayFind
          • ArrayFindAll
          • ArrayFindAllNoCase
          • ArrayFindNoCase
          • ArrayFirst
          • ArrayGetMetadata
          • ArrayIndexExists
          • ArrayInsertAt
          • ArrayIsDefined
          • ArrayLast
          • ArrayMap
          • ArrayMax
          • ArrayMedian
          • ArrayMerge
          • ArrayMid
          • ArrayMin
          • ArrayNew
          • ArrayPop
          • ArrayPrepend
          • ArrayPush
          • ArrayRange
          • ArrayReduce
          • ArrayReduceRight
          • ArrayResize
          • ArrayReverse
          • ArraySet
          • ArrayShift
          • ArraySlice
          • ArraySome
          • ArraySort
          • ArraySplice
          • ArraySum
          • ArraySwap
          • ArrayToList
          • ArrayToStruct
          • ArrayUnshift
        • async
          • ExecutorGet
          • ExecutorHas
          • ExecutorList
          • ExecutorNew
          • ExecutorShutdown
          • ExecutorStatus
          • FutureNew
          • IsInThread
          • RunAsync
          • ThreadJoin
          • ThreadNew
          • ThreadTerminate
        • bifs
          • BoxLangBIFProxy
        • binary
          • BinaryDecode
          • BinaryEncode
          • BitAnd
          • BitMaskClear
          • BitMaskRead
          • BitMaskSet
          • BitNot
          • BitOr
          • bitShln
          • bitShrn
          • BitXor
        • cache
          • Cache
          • CacheFilter
          • CacheNames
          • CacheProviders
          • CacheService
        • cli
          • CLIExit
          • CLIGetArgs
          • CLIRead
        • conversion
          • DataNavigate
          • JSONDeserialize
          • JSONPrettify
          • JSONSerialize
          • LSParseNumber
          • ParseNumber
          • ToBase64
          • ToBinary
          • ToModifiable
          • ToNumeric
          • ToScript
          • ToString
          • ToUnmodifiable
        • decision
          • ArrayIsEmpty
          • Attempt
          • IsArray
          • IsBinary
          • IsBoolean
          • IsClosure
          • IsCustomFunction
          • IsDate
          • IsDateObject
          • IsDebugMode
          • IsDefined
          • IsEmpty
          • IsFileObject
          • IsIPv6
          • IsJSON
          • IsLeapYear
          • IsLocalHost
          • IsNull
          • IsNumeric
          • IsNumericDate
          • IsObject
          • IsQuery
          • IsSimpleValue
          • IsStruct
          • IsValid
          • IsXML
          • IsXmlAttribute
          • IsXMLDoc
          • IsXMLElem
          • IsXMLNode
          • IsXMLRoot
          • LSIsNumeric
          • structIsEmpty
        • encryption
          • Decrypt
          • Encrypt
          • EncryptBinary
          • GeneratePDBKDFKey
          • GenerateSecretKey
          • Hash
          • Hash40
          • Hmac
        • format
          • BooleanFormat
          • DecimalFormat
          • LSNumberFormat
          • NumberFormat
        • i18n
          • ClearLocale
          • CurrencyFormat
          • GetLocale
          • GetLocaleDisplayName
          • GetLocaleInfo
          • IsCurrency
          • LSCurrencyFormat
          • LSIsCurrency
          • LSParseCurrency
          • ParseCurrency
          • SetLocale
        • io
          • ContractPath
          • CreateTempDirectory
          • CreateTempFile
          • DirectoryCopy
          • DirectoryCreate
          • DirectoryDelete
          • DirectoryExists
          • DirectoryList
          • DirectoryMove
          • DirectoryRename
          • ExpandPath
          • FileAppend
          • FileClose
          • FileCopy
          • FileDelete
          • FileExists
          • FileGetMimeType
          • FileInfo
          • FileIsEOF
          • FileMove
          • FileOpen
          • FileRead
          • FileReadBinary
          • FileReadLine
          • FileSeek
          • FileSetAccessMode
          • FileSetAttribute
          • FileSetLastModified
          • FileSkipBytes
          • FileWrite
          • FileWriteLine
          • GetCanonicalPath
          • GetDirectoryFromPath
          • GetFileInfo
          • getTempFile
        • java
          • CreateDynamicProxy
        • jdbc
          • IsInTransaction
          • IsWithinTransaction
          • PreserveSingleQuotes
          • QueryExecute
          • TransactionCommit
          • TransactionRollback
          • TransactionSetSavepoint
        • list
          • GetToken
          • ListAppend
          • ListAvg
          • ListChangeDelims
          • ListCompact
          • ListContains
          • ListContainsNoCase
          • ListDeleteAt
          • ListEach
          • ListEvery
          • ListFilter
          • ListFind
          • ListFindNoCase
          • ListFirst
          • ListGetAt
          • ListIndexExists
          • ListInsertAt
          • ListItemTrim
          • ListLast
          • ListLen
          • ListMap
          • ListPrepend
          • ListQualify
          • ListReduceRight
          • ListRemoveDuplicates
          • ListRest
          • ListSetAt
          • ListSome
          • ListSort
          • ListToArray
          • ListTrim
          • ListValueCount
          • ListValueCountNoCase
        • math
          • Abs
          • Acos
          • Asin
          • Atn
          • Ceiling
          • Cos
          • DecrementValue
          • Exp
          • Fix
          • Floor
          • FormatBaseN
          • IncrementValue
          • InputBaseN
          • Int
          • Log
          • Log10
          • Max
          • Min
          • Pi
          • PrecisionEvaluate
          • Rand
          • Randomize
          • RandRange
          • Round
          • Sgn
          • Sin
          • Sqr
          • Tan
        • query
          • QueryAddColumn
          • QueryAddRow
          • QueryAppend
          • QueryClear
          • QueryColumnArray
          • QueryColumnCount
          • QueryColumnData
          • QueryColumnExists
          • QueryColumnList
          • QueryCurrentRow
          • QueryDeleteColumn
          • QueryDeleteRow
          • QueryEach
          • QueryEvery
          • QueryFilter
          • QueryGetCell
          • QueryGetResult
          • QueryInsertAt
          • QueryKeyExists
          • QueryMap
          • QueryNew
          • QueryPrepend
          • QueryRecordCount
          • QueryReduce
          • QueryRegisterFunction
          • QueryReverse
          • QueryRowData
          • QueryRowSwap
          • QuerySetCell
          • QuerySetRow
          • QuerySlice
          • QuerySome
          • QuerySort
        • string
          • Ascii
          • CamelCase
          • Char
          • CharsetDecode
          • CharsetEncode
          • Compare
          • CompareNoCase
          • Find
          • FindNoCase
          • FindOneOf
          • Insert
          • JSStringFormat
          • KebabCase
          • LCase
          • Left
          • ListReduce
          • LJustify
          • LTrim
          • Mid
          • ParagraphFormat
          • PascalCase
          • QueryStringToStruct
          • ReEscape
          • ReFind
          • reFindNoCase
          • ReMatch
          • reMatchNoCase
          • RemoveChars
          • RepeatString
          • Replace
          • ReplaceList
          • ReplaceListNoCase
          • ReplaceNoCase
          • ReReplace
          • reReplaceNoCase
          • Reverse
          • Right
          • RJustify
          • RTrim
          • Slugify
          • SnakeCase
          • SpanExcluding
          • SpanIncluding
          • SQLPrettify
          • StringBind
          • StringEach
          • StringEvery
          • StringFilter
          • StringMap
          • StringReduce
          • StringReduceRight
          • StringSome
          • StringSort
          • StripCR
          • Trim
          • TrueFalseFormat
          • UCase
          • UCFirst
          • Val
          • Wrap
          • YesNoFormat
        • struct
          • StructAppend
          • StructClear
          • StructCopy
          • StructDelete
          • StructEach
          • StructEquals
          • StructEvery
          • StructFilter
          • StructFind
          • StructFindKey
          • StructFindValue
          • StructGet
          • StructGetMetadata
          • StructInsert
          • StructIsCaseSensitive
          • StructIsOrdered
          • StructKeyArray
          • StructKeyExists
          • StructKeyList
          • StructKeyTranslate
          • StructMap
          • StructNew
          • StructReduce
          • StructSome
          • StructSort
          • StructToQueryString
          • StructToSorted
          • StructUpdate
          • StructValueArray
        • system
          • ApplicationRestart
          • ApplicationStartTime
          • ApplicationStop
          • BoxAnnounce
          • BoxAnnounceAsync
          • BoxRegisterInterceptionPoints
          • BoxRegisterInterceptor
          • BoxRegisterRequestInterceptor
          • CallStackGet
          • CreateGUID
          • CreateObject
          • CreateUUID
          • DE
          • DebugBoxContexts
          • Dump
          • Duplicate
          • echo
          • EncodeForHTML
          • GetApplicationMetadata
          • GetBaseTagData
          • GetBaseTagList
          • GetBaseTemplatePath
          • GetBoxContext
          • GetBoxRuntime
          • GetBoxVersionInfo
          • GetClassMetadata
          • GetComponentList
          • GetContextRoot
          • GetCurrentTemplatePath
          • GetFileFromPath
          • GetFunctionCalledName
          • GetFunctionList
          • GetModuleInfo
          • GetModuleList
          • GetRequestClassLoader
          • GetSemver
          • GetSystemSetting
          • GetTempDirectory
          • GetTickCount
          • htmlEditFormat
          • IIF
          • Invoke
          • IsInstanceOf
          • JavaCast
          • ObjectDeserialize
          • ObjectSerialize
          • PagePoolClear
          • Print
          • Println
          • RunThreadInContext
          • SessionInvalidate
          • SessionRotate
          • SessionStartTime
          • Sleep
          • SystemCacheClear
          • SystemExecute
          • SystemOutput
          • Throw
          • Trace
          • URLDecode
          • URLEncodedFormat
          • writeDump
          • WriteLog
          • WriteOutput
        • temporal
          • ClearTimezone
          • CreateDate
          • CreateDateTime
          • CreateODBCDate
          • CreateODBCDateTime
          • CreateODBCTime
          • CreateTime
          • CreateTimeSpan
          • DateAdd
          • DateCompare
          • DateConvert
          • DateDiff
          • DateFormat
          • DatePart
          • DateTimeFormat
          • Day
          • DayOfWeek
          • DayOfWeekAsString
          • DayOfWeekShortAsString
          • DayOfYear
          • DaysInMonth
          • DaysInYear
          • FirstDayOfMonth
          • GetNumericDate
          • GetTime
          • GetTimezone
          • GetTimezoneInfo
          • Hour
          • Millisecond
          • Minute
          • Month
          • MonthAsString
          • MonthShortAsString
          • Nanosecond
          • Now
          • Offset
          • ParseDateTime
          • Quarter
          • Second
          • SetTimezone
          • TimeFormat
          • Week
          • Year
        • type
          • ArrayLen
          • GetMetaData
          • Len
          • NullValue
          • StringLen
          • StructCount
        • web
          • HtmlHead
          • GetHTTPTimeString
          • GetHTTPRequestData
          • HtmlFooter
          • SetEncoding
          • Forward
          • Location
          • GetPageContext
          • FileUpload
          • FileUploadAll
        • xml
          • XMLChildPos
          • XMLElemNew
          • XMLFormat
          • XMLGetNodeType
          • XMLNew
          • XMLParse
          • XMLSearch
          • XMLTransform
          • XMLValidate
        • zip
          • Compress
          • Extract
          • IsZipFile
      • Components
        • async
          • Thread
        • cache
          • Cache
        • debug
          • Stopwatch
          • Timer
        • io
          • Directory
          • File
        • jdbc
          • DBInfo
          • ProcParam
          • ProcResult
          • Query
          • QueryParam
          • StoredProc
          • Transaction
        • net
          • HTTP
          • HTTPParam
        • system
          • Abort
          • Application
          • Associate
          • Component
          • Dump
          • Execute
          • Exit
          • Flush
          • Include
          • Invoke
          • InvokeArgument
          • Lock
          • Log
          • Loop
          • Object
          • Output
          • Param
          • ProcessingDirective
          • SaveContent
          • Setting
          • Silent
          • Sleep
          • Throw
          • Trace
        • web
          • HtmlHead
          • HtmlFooter
          • Location
          • Cookie
          • Header
          • Content
        • xml
          • XML
        • zip
          • Zip
      • Exceptions
  • BoxLang Framework
    • Application.bx
    • Asynchronous Programming
    • File Handling
    • Interceptors
      • Core Interception Points
        • Application Events
        • Cache Service Events
        • Cache Provider Events
        • Cache Object Store Events
        • Datasource Service Events
        • Dump Events
        • Dynamic Object Events
        • Function Invocations
        • HTTP Events
        • Life-cycle Events
        • Logging Events
        • Module Events
        • Module Service Events
        • Object Marshalling Events
        • Query Invocations
        • Runtime Events
        • Request Context Events
        • Scheduler Events
        • Scheduler Service Events
        • Template Invocations
        • Transaction Events
      • Request Interception Points
    • HTTP/S Calls
    • Java Interop
    • JDBC Transactions
    • Modules
      • AI
      • Compat CFML
        • Reference
          • Types
            • array
            • datetime
            • numeric
            • string
            • struct
          • Built-in Functions
            • cache
              • CacheCount
              • CacheGetAsAttempt
              • CacheRegionRemove
              • CacheRemoveAll
              • CachePut
              • CacheRegionExists
              • CacheGetSession
              • CacheGetEngineProperties
              • CacheGet
              • CacheGetDefaultCacheName
              • CacheGetProperties
              • CacheSetProperties
              • CacheGetAllIds
              • CacheIdExists
              • cacheKeyExists
              • CacheRemove
              • cacheDelete
              • CacheGetAll
              • CacheGetMetadata
              • CacheGetOrFail
              • CacheClear
              • CacheRegionNew
            • conversion
              • JSONDeserialize
            • encryption
              • Hash
              • Hash40
            • format
              • HTMLCodeFormat
              • DollarFormat
            • struct
              • DeleteClientVariable
            • system
              • Throw
              • ObjectSave
              • GetFunctionData
              • GetComponentMetadata
              • GetVariable
              • GetTagData
              • GetClientVariablesList
              • GetContextRoot
              • ObjectLoad
              • SetVariable
            • temporal
              • LSWeek
              • LSDayOfWeek
              • LSIsDate
              • DateCompare
              • GetHTTPTimestring
              • LSDateTimeFormat
              • LSDateFormat
              • LSTimeFormat
              • DayOfWeekAsString
              • DayOfWeekShortAsString
              • MonthAsString
              • MonthShortAsString
              • ToLegacyDate
              • createDate
              • LSParseDateTime
              • DateTimeFormat
              • DateFormat
              • TimeFormat
            • type
              • GetMetaData
          • Components
            • net
              • HTTP
      • CSRF
      • ESAPI
      • Evaluating Code
      • FTP
      • Image Manipulation
      • INI Files
      • JDBC
      • Jython
      • Mail
      • Markdown
      • ORM
      • OSHI - Operating System + Hardware
      • Password Encryption
      • PDF
      • Redis
      • UI Forms
      • WDDX
      • Web Support
      • Yaml
  • Extra Credit
    • MVC
    • Dependency Injection
Powered by GitBook
LogoLogo

Social Media

  • X
  • FaceBook
  • LinkedIn
  • YouTube

Bug Tracking

  • Runtimes
  • IDE
  • Modules

Support

  • Professional
  • Community
  • Slack

Copyright & Register Trademark by Ortus Solutions, Corp

On this page
  • String Methods
  • Examples

Was this helpful?

Edit on GitHub
Export as PDF
  1. BoxLang Language
  2. Reference
  3. Types

string

String Methods

year(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

quarter(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

month(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

monthAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

monthShortAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

day(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

dayOfWeek(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

dayOfWeekAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

dayOfWeekShortAsString(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

daysInMonth(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

daysInYear(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

dayOfYear(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

firstDayOfMonth(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

week(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

hour(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

minute(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

second(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

millisecond(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

nanosecond(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

offset(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

timezone(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

getnumericdate(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

getTime(timezone=[string], locale=[string])

Provides the BIF and member functions for all time unit request with no arguments

Arguments:

Argument
Type
Required
Default

timezone

string

false

null

locale

string

false

null

dateFormat(mask=[string], timezone=[string], locale=[string])

Formats a datetime, date or time

Arguments:

Argument
Type
Required
Default

mask

string

false

null

timezone

string

false

null

locale

string

false

null

timeFormat(mask=[string], timezone=[string], locale=[string])

Formats a datetime, date or time

Arguments:

Argument
Type
Required
Default

mask

string

false

null

timezone

string

false

null

locale

string

false

null

dateTimeFormat(mask=[string], timezone=[string], locale=[string])

Formats a datetime, date or time

Arguments:

Argument
Type
Required
Default

mask

string

false

null

timezone

string

false

null

locale

string

false

null

parseDateTime(format=[string], timezone=[string], locale=[string])

Parses a datetime string or object

Arguments:

Argument
Type
Required
Default

format

string

false

null

timezone

string

false

null

locale

string

false

null

toDateTime(format=[string], timezone=[string], locale=[string])

Parses a datetime string or object

Arguments:

Argument
Type
Required
Default

format

string

false

null

timezone

string

false

null

locale

string

false

null

hash(algorithm=[string], encoding=[string], numIterations=[integer])

Creates an algorithmic hash of an object

Arguments:

Argument
Type
Required
Default

algorithm

string

false

MD5

encoding

string

false

utf-8

numIterations

integer

false

1

hmac(key=[any], algorithm=[string], encoding=[string], numIterations=[integer])

Creates an algorithmic hash of an object

Arguments:

Argument
Type
Required
Default

key

any

true

null

algorithm

string

false

HmacMD5

encoding

string

false

utf-8

numIterations

integer

false

1

inputBaseN(radix=[integer])

Converts a string, using the base specified by radix, to an integer.

Arguments:

Argument
Type
Required
Default

radix

integer

true

null

xMLFormat(escapeChars=[boolean])

Formats a string so that special XML characters can be used as text in XML

Arguments:

Argument
Type
Required
Default

escapeChars

boolean

false

false

uRLEncodedFormat()

Generates a URL-encoded string.

For example, it replaces spaces with %20, and non-alphanumeric characters with equivalent hexadecimal escape sequences. Passes arbitrary strings within a URL. *

len()

Returns the absolute value of a number

listSome(callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])

Tests whether any item in a list meets the specified callback

Arguments:

Argument
Type
Required
Default

callback

function:Predicate

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

parallel

boolean

false

false

maxThreads

integer

false

null

listReduceRight(callback=[function:BiFunction], initialValue=[any], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Run the provided udf over a reversed delimited list to reduce the values to a single output

Arguments:

Argument
Type
Required
Default

callback

function:BiFunction

true

null

initialValue

any

false

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

listPrepend(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Filters a delimted list and returns the values from the callback test

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

listFirst(delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Returns the first or last item in a delimited list, according to the specified function name

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listLast(delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Returns the first or last item in a delimited list, according to the specified function name

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listIndexExists(index=[integer], delimiter=[string], includeEmptyFields=[boolean])

Checks if a list has a given index

Arguments:

Argument
Type
Required
Default

index

integer

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

listInsertAt(position=[integer], value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Filters a delimted list and returns the values from the callback test

Arguments:

Argument
Type
Required
Default

position

integer

true

null

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

listChangeDelims(newDelimiter=[string], delimiter=[string], includeEmptyFields=[boolean])

Converts the delimiters of a list to the new delimiter.

Arguments:

Argument
Type
Required
Default

newDelimiter

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

listFind(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Return int position of value in delimited list, case sensitive or case-insenstive variations

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listFindNoCase(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Return int position of value in delimited list, case sensitive or case-insenstive variations

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listContains(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Return int position of value in delimited list, case sensitive or case-insenstive variations

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listContainsNoCase(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Return int position of value in delimited list, case sensitive or case-insenstive variations

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listCompact(delimiter=[string], multiCharacterDelimiter=[boolean])

Compacts a list by removing empty items from the start and end of the list

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

multiCharacterDelimiter

boolean

false

false

listTrim(delimiter=[string], multiCharacterDelimiter=[boolean])

Compacts a list by removing empty items from the start and end of the list

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

multiCharacterDelimiter

boolean

false

false

listMap(callback=[function:Function], delimiter=[string], includeEmptyFields=[boolean], parallel=[boolean], maxThreads=[integer])

Used to iterate over a delimited list and run the function closure for each item in the list and create a new list from the returned values.

Arguments:

Argument
Type
Required
Default

callback

function:Function

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

parallel

boolean

false

false

maxThreads

integer

false

null

listDeleteAt(position=[integer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Deletes an element from a list.

Returns a copy of the list, without the specified element.

Arguments:

Argument
Type
Required
Default

position

integer

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listRemoveDuplicates(delimiter=[string], ignoreCase=[boolean])

De-duplicates a delimited list - either case-sensitively or case-insenstively

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

ignoreCase

boolean

false

false

listToArray(delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Converts a delimited list to an array

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listQualify(qualifier=[string], delimiter=[string], elements=[string], includeEmptyFields=[boolean])

Inserts a string at the beginning and end of list elements.

Arguments:

Argument
Type
Required
Default

qualifier

string

true

null

delimiter

string

false

,

elements

string

false

all

includeEmptyFields

boolean

false

false

listAppend(value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Appends an element to a list

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

listValueCount(value=[string], delimiter=[string], includeEmptyFields=[boolean])

returns a count of the number of occurrences of a value in a list

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

listValueCountNoCase(value=[string], delimiter=[string], includeEmptyFields=[boolean])

returns a count of the number of occurrences of a value in a list

Arguments:

Argument
Type
Required
Default

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

listAvg(delimiter=[string], multiCharacterDelimiter=[boolean])

Gets the average of all values in a list

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

multiCharacterDelimiter

boolean

false

false

listLen(delimiter=[string], includeEmptyFields=[boolean])

Calculates the length of a list separated by the specified delimiter

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

includeEmptyFields

boolean

false

false

listRest(delimiter=[string], includeEmptyFields=[boolean], offset=[integer])

Returns the remainder of a list after removing the first item

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

includeEmptyFields

boolean

false

false

offset

integer

false

0

listGetAt(position=[integer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Retrieves an item from a delimited list at the specified position

Arguments:

Argument
Type
Required
Default

position

integer

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

listEvery(callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])

Tests whether all items in a list meet the specified callback

Arguments:

Argument
Type
Required
Default

callback

function:Predicate

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

parallel

boolean

false

false

maxThreads

integer

false

null

listEach(callback=[function:Consumer], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer], ordered=[boolean])

Used to iterate over a delimited list and run the function closure for each item in the list.

Arguments:

Argument
Type
Required
Default

callback

function:Consumer

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

parallel

boolean

false

false

maxThreads

integer

false

null

ordered

boolean

false

false

listSort(sortType=[any], sortOrder=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], localeSensitive=[boolean], callback=[any])

Sorts a delimited list and returns the result

Arguments:

Argument
Type
Required
Default

sortType

any

false

null

sortOrder

string

false

asc

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

localeSensitive

boolean

false

null

callback

any

false

null

listSetAt(position=[integer], value=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Retrieves an item in to a delimited list at the specified position

Arguments:

Argument
Type
Required
Default

position

integer

true

null

value

string

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

listFilter(filter=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])

Filters a delimted list and returns the values from the callback test

Arguments:

Argument
Type
Required
Default

filter

function:Predicate

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

parallel

boolean

false

false

maxThreads

integer

false

null

getToken(index=[integer], delimiter=[string])

Determines whether a token of the list in the delimiters parameter is present in a string.

Returns the token found at position index of the string, as a string. If index is greater than the number of tokens in the string, returns an empty string.

Arguments:

Argument
Type
Required
Default

index

integer

true

null

delimiter

string

false

,

listItemTrim(delimiter=[string], includeEmptyFields=[boolean])

Trims each item in the list.

Arguments:

Argument
Type
Required
Default

delimiter

string

false

,

includeEmptyFields

boolean

false

false

jSONPrettify()

Prettifies a JSON string.

fromJSON(strictMapping=[boolean], useCustomSerializer=[string])

Converts a JSON (JavaScript Object Notation) string data representation into data, such as a structure or array.

Arguments:

Argument
Type
Required
Default

strictMapping

boolean

false

true

useCustomSerializer

string

false

null

toBase64(encoding=[string])

Calculates the Base64 representation of a string or binary object.

The Base64 format uses printable characters, allowing binary data to be sent in forms and e-mail, and stored in a database or file.

Arguments:

Argument
Type
Required
Default

encoding

string

false

UTF-8

toBinary()

Calculates the binary representation of Base64-encoded data.

to(encoding=[string])

Converts a value to a string.

Arguments:

Argument
Type
Required
Default

encoding

string

false

null

listToJSON(queryFormat=[string], useSecureJSONPrefix=[string], useCustomSerializer=[boolean])

Converts a BoxLang variable into a JSON (JavaScript Object Notation) string.

Arguments:

Argument
Type
Required
Default

queryFormat

string

false

row

useSecureJSONPrefix

string

false

false

useCustomSerializer

boolean

false

null

toJSON(queryFormat=[string], useSecureJSONPrefix=[string], useCustomSerializer=[boolean])

Converts a BoxLang variable into a JSON (JavaScript Object Notation) string.

Arguments:

Argument
Type
Required
Default

queryFormat

string

false

row

useSecureJSONPrefix

string

false

false

useCustomSerializer

boolean

false

null

booleanFormat()

Returns the value formatted as a boolean string

isEmpty()

Determine whether a given value is empty.

We check for emptiness of anything that can be casted to: Array, Struct, Query, or String.

spanIncluding(set=[string])

Gets characters from a string, from the beginning to a character that is NOT in a specified set of characters.

The search is case-sensitive.

Arguments:

Argument
Type
Required
Default

set

string

true

null

reFind(reg_expression=[string], start=[integer], returnSubExpressions=[boolean], scope=[string])

Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.

The search is case-sensitive. It will return numeric if returnsubexpressions is false and a struct of arrays named "len", "match" and "pos" when returnsubexpressions is true.

Arguments:

Argument
Type
Required
Default

reg_expression

string

true

null

start

integer

false

1

returnSubExpressions

boolean

false

false

scope

string

false

one

reFindNoCase(reg_expression=[string], start=[integer], returnSubExpressions=[boolean], scope=[string])

Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.

The search is case-sensitive. It will return numeric if returnsubexpressions is false and a struct of arrays named "len", "match" and "pos" when returnsubexpressions is true.

Arguments:

Argument
Type
Required
Default

reg_expression

string

true

null

start

integer

false

1

returnSubExpressions

boolean

false

false

scope

string

false

one

kebabCase()

Convert a string to kebab case

ascii()

Determine the ASCII value of a character

val()

Converts numeric characters and the first period found that occur at the beginning of a string to a number.

A period not accompianied by at least one numeric digit will be ignored. If no numeric digits are found at the start of the string, zero will be returned.

compare(string2=[any])

Performs a case-sensitive comparison of two strings.

-1, if string1 is less than string2 0, if string1 is equal to string2 1, if string1 is greater than string2

Arguments:

Argument
Type
Required
Default

string2

any

true

null

trueFalseFormat()

Return Yes/No based on whether the input is true/false

reReplace(regex=[string], substring=[string], scope=[string])

Uses a regular expression (regex) to search a string for a string pattern and replace it with another.

The search is case-sensitive.

Arguments:

Argument
Type
Required
Default

regex

string

true

null

substring

string

true

null

scope

string

true

one

reReplaceNoCase(regex=[string], substring=[string], scope=[string])

Uses a regular expression (regex) to search a string for a string pattern and replace it with another.

The search is case-sensitive.

Arguments:

Argument
Type
Required
Default

regex

string

true

null

substring

string

true

null

scope

string

true

one

stripCR()

Deletes return characters from a string.

insert(substring=[string], position=[integer])

Inserts a substring into another string at a specified position.

Arguments:

Argument
Type
Required
Default

substring

string

true

null

position

integer

true

null

camelCase()

Convert a string to camel case

bind(placeholders=[structloose])

This BIF allows you to bind a string with placeholders to a set of values.

Each placeholder is defined as ,{@code ${placeholder-name}}, and can be used anywhere and multiple times in the string.

Arguments:

Argument
Type
Required
Default

placeholders

struct

true

null

snakeCase()

Convert a string to snake case

right(count=[integer])

Extract the rightmost count characters from a string

Arguments:

Argument
Type
Required
Default

count

integer

true

null

findOneOf(set=[string], start=[integer])

Finds the first occurrence of any character in a set of characters, from a specified start position.

Arguments:

Argument
Type
Required
Default

set

string

true

null

start

integer

false

1

spanExcluding(set=[string])

Get characters from a string, from the beginning to a character that is in a specified set of characters.

The search is case-sensitive.

Arguments:

Argument
Type
Required
Default

set

string

true

null

compareNoCase(string2=[string])

Performs a case-insensitive comparison of two strings.

-1, if string1 is less than string2 0, if string1 is equal to string2 1, if string1 is greater than string2

Arguments:

Argument
Type
Required
Default

string2

string

true

null

stringReduceRight(callback=[function:BiFunction], initialValue=[any], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Run the provided udf over a reversed string to reduce the values to a single output

Arguments:

Argument
Type
Required
Default

callback

function:BiFunction

true

null

initialValue

any

false

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

reverse()

Reverse the order of characters in a string

replace(substring1=[string], obj=[any], scope=[string])

Replaces occurrences of substring1 in a string with obj, in a specified scope.

The search is case-sensitive. Function returns original string with replacements made

Arguments:

Argument
Type
Required
Default

substring1

string

true

null

obj

any

true

null

scope

string

true

one

replaceList(list1=[string], list2=[string], delimiter_list1=[string], delimiter_list2=[string], includeEmptyFields=[boolean])

Replaces occurrences of the elements from a delimited list, in a string with corresponding elements from another delimited list.

Arguments:

Argument
Type
Required
Default

list1

string

true

null

list2

string

true

null

delimiter_list1

string

false

,

delimiter_list2

string

false

,

includeEmptyFields

boolean

false

false

replaceListNoCase(list1=[string], list2=[string], delimiter_list1=[string], delimiter_list2=[string], includeEmptyFields=[boolean])

Replaces occurrences of the elements from a delimited list, in a string with corresponding elements from another delimited list.

Arguments:

Argument
Type
Required
Default

list1

string

true

null

list2

string

true

null

delimiter_list1

string

false

,

delimiter_list2

string

false

,

includeEmptyFields

boolean

false

false

slugify(maxLength=[integer], allow=[string])

Slugify a string for URL safety

Arguments:

Argument
Type
Required
Default

maxLength

integer

false

0

allow

string

false

null

wrap(limit=[integer], strip=[boolean])

Wraps a string at the specified limit, breaking at the last space within the limit.

Arguments:

Argument
Type
Required
Default

limit

integer

true

null

strip

boolean

false

false

pascalCase()

Convert a string to pascal case

stringSort(sortType=[any], sortOrder=[string], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], localeSensitive=[boolean], callback=[any])

Sorts a string and returns the result

Arguments:

Argument
Type
Required
Default

sortType

any

false

null

sortOrder

string

false

asc

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

false

localeSensitive

boolean

false

null

callback

any

false

null

trim()

Trim whitespace from the beginning and end of a string

lTrim()

Trim leading whitespace from a string

uCFirst(doAll=[boolean], doLowerIfAllUppercase=[boolean])

Transform the first letter of a string to uppercase or the first letter of each word, and optionally lowercase uppercase characters.

Arguments:

Argument
Type
Required
Default

doAll

boolean

false

false

doLowerIfAllUppercase

boolean

false

false

find(substring=[string], start=[integer])

Finds the first occurrence of a substring in a string, from a specified start position.

Arguments:

Argument
Type
Required
Default

substring

string

true

null

start

integer

false

1

findNoCase(substring=[string], start=[integer])

Finds the first occurrence of a substring in a string, from a specified start position.

Arguments:

Argument
Type
Required
Default

substring

string

true

null

start

integer

false

1

reMatch(reg_expression=[string])

Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.

Arguments:

Argument
Type
Required
Default

reg_expression

string

true

null

reMatchNoCase(reg_expression=[string])

Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.

Arguments:

Argument
Type
Required
Default

reg_expression

string

true

null

lJustify(length=[integer])

Justifies characters in a string of a specified length, either left or right.

Arguments:

Argument
Type
Required
Default

length

integer

true

null

rJustify(length=[integer])

Justifies characters in a string of a specified length, either left or right.

Arguments:

Argument
Type
Required
Default

length

integer

true

null

left(count=[integer])

Extract the leftmost count characters from a string

Arguments:

Argument
Type
Required
Default

count

integer

true

null

uCase()

Uppercase a string

listReduce(callback=[function:BiFunction], initialValue=[any], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])

Run the provided udf over a delimited list to reduce the values to a single output

Arguments:

Argument
Type
Required
Default

callback

function:BiFunction

true

null

initialValue

any

false

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

yesNoFormat()

Return Yes/No based on whether the input is true/false

replaceNoCase(substring1=[string], obj=[any], scope=[string], start=[string])

Replaces occurrences of substring1 in a string with obj, in a specified scope.

The search is case-sensitive. Function returns original string with replacements made

Arguments:

Argument
Type
Required
Default

substring1

string

true

null

obj

any

true

null

scope

string

true

one

start

string

false

1

removeChars(start=[integer], count=[integer])

Removes characters from a string.

Arguments:

Argument
Type
Required
Default

start

integer

true

null

count

integer

true

null

rTrim()

Trim trailing whitespace from a string

jsFormat()

Escapes special JavaScript characters, such as single quotation mark, double quotation mark, and newline

charsetDecode(encoding=[string])

Encodes a string to a binary representation

Arguments:

Argument
Type
Required
Default

encoding

string

false

utf-8

stringSome(callback=[function:Predicate], delimiter=[string], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean], parallel=[boolean], maxThreads=[integer])

Tests whether any item in a string meets the specified callback

Arguments:

Argument
Type
Required
Default

callback

function:Predicate

true

null

delimiter

string

false

,

includeEmptyFields

boolean

false

false

multiCharacterDelimiter

boolean

false

true

parallel

boolean

false

false

maxThreads

integer

false

null

sQLPrettify()

Prettify a SQL string

mid(start=[integer], count=[integer])

Extract a substring from a string

Arguments:

Argument
Type
Required
Default

start

integer

true

null

count

integer

true

null

lCase()

Uppercase a string

paragraphFormat()

Replaces characters in a string: Single newline characters (CR/LF sequences) with spaces and double newline characters with HTML paragraph tags

Examples

PreviousstreamNextstruct

Last updated 1 month ago

Was this helpful?