Text Functions

Functions for formatting text values. These are commonly used in the labeling and popup profiles.

Concatenate

Concatenate( values, separator?, format? ) -> returns: String

Concatenates values together and returns a string.

Name Type Description
values String[] An array of string values to concatenate.
separator String optional Separator to use for concatenation if values parameter is an array. Or string to concatenate, if a single value is provided for the first parameter. If not provided will be empty.
format String optional Formatting string for dates or numbers. This parameter is available in Arcade version 1.3 and later. See the list of possible values below.

ValueDescription
0Digit
#Digit, omitting leading/trailing zeros
dDay of the week
DDay of the month
dddAbbreviated day of the week
ddddFull day of the week
MMonth number
MMMAbbreviated month name
MMMMFull month name
YYTwo-digit year
YFull year
h12-hour time (0-12)
H24-hour time (0-24)
mTwo digit minute
sTwo digit second
Returns: String
Example

prints 'red/blue/green'

Concatenate(['red', 'blue', 'green'], '/')

Find

Find( searchText, text, startpos? ) -> returns: Number

Finds a string within a string. Wildcards are NOT supported.

Name Type Description
searchText String The sub string to search for.
text String The text to search.
startpos Number optional The zero-based index of the location in the string to search from.
Returns: Number
Example

prints 6

Find('380', 'Esri, 380 New York Street', 0)

Left

Left( value, charCount ) -> returns: String

Returns the specified number of characters from the beginning of a string.

Name Type Description
value String / Array / Number / Boolean The string from which to get characters.
charCount Number The number of characters to get from the beginning of the string.
Returns: String
Example

prints 'the'

Left('the quick brown fox', 3)

Lower

Lower( value ) -> returns: String

Makes a string lower case.

Name Type Description
value String The string to be made lowercase.
Returns: String
Example

prints 'hello'

Lower('HELLO')

Mid

Mid( value, startpos, charCount ) -> returns: String

Gets a number of characters from the middle of a string.

Name Type Description
value String / Array / Number / Boolean The string from which to get characters.
startpos Number The starting position from which to get the string. 0 is the first position.
charCount Number The number of characters to extract.
Returns: String
Example

prints 'quick'

Mid('the quick brown fox', 4, 5)

Proper

Proper( value, applyTo? ) -> returns: String

Converts a string to title case. By default, the beginning of every word is capitalized. The option firstword will capitalize only the first word.

Name Type Description
value String The string to convert to title case.
applyTo String optional A string specifying the type of capitalization to be performed. By default every word is capitalized. This parameter accepts one of two values: everyword or firstword.
Returns: String
Example

prints 'The Quick Brown Fox'

Proper('the quick brown fox', 'everyword')

Replace

Replace( value, searchString, replacestring, allOccurrences? ) -> returns: String

Replaces a string within a string or an element within an array. Defaults to replacing all occurrences.

Name Type Description
value String / Array / Number / Boolean The string in which to make replacements.
searchString String The string to search for.
replacestring String The replacement string.
allOccurrences Boolean optional Indicates if all occurrences of the searchString should be replaced in the text. Defaults to true.
Returns: String
Example

prints 'the quick red fox'

Replace('the quick brown fox', 'brown', 'red')

Right( value, charCount ) -> returns: String

Returns the specified number of characters from the end of a string.

Name Type Description
value String / Array / Number / Boolean The string from which to get characters.
charCount Number The number of characters to get from the end of the string.
Returns: String
Example

prints 'fox'

Right('the quick brown fox', 3)

Split

Split( value, separator, limit?, removeEmpty? ) -> returns: String[]

Splits a string into an array.

Name Type Description
value String The string to be split.
separator String The separator used to split the string.
limit Number optional An integer that specifies the number of splits.
removeEmpty Boolean optional Indicates whether to remove empty values. By default this is false.
Returns: String[]
Example

returns '[red,green]'

Split('red,green,blue,orange', ',', 2)

Trim

Trim( value ) -> returns: String

Removes spaces from the beginning or end of an input string.

Name Type Description
value String The string to be trimmed.
Returns: String
Example

prints 'hello world'

Trim('   hello world')

Upper

Upper( value ) -> returns: String

Makes a string upper case.

Name Type Description
value String The string to be made uppercase.
Returns: String
Example

prints 'HELLO'

Upper('Hello')


Feedback on this topic?