Text Functions

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

Concatenate

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

Concatenates values together and returns a text value.

Name Type Description
values Text[] An array of text values to concatenate.
separator Text optional Separator to use for concatenation if values parameter is an array. Or text to concatenate, if a single value is provided for the first parameter. If not provided will be empty.
format Text optional Formatting text 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 month, not padded (1 - 31).
DDDay of the month, padded (01 - 31).
DDDOrdinal day of the year (1 - 365).
dDay of the week (1 - 7)
dddAbbreviated day of the week (e.g. Mon)
ddddFull day of the week (e.g. Monday).
MMonth number (1 - 12)
MMMonth number, padded (01 - 12).
MMMAbbreviated month name (e.g. Jan).
MMMMFull month name (e.g. January)
mMinutes, not padded (0 - 59).
mmMinutes, padded (00 - 59).
YFull year
YYTwo-digit year
hCivilian hours, not padded (0 - 12)
hhCivilian hours, padded (00 - 12)
HMilitary hours, not padded (0 - 24)
HHMilitary hours, padded (00 - 24)
sSeconds, not padded (0 - 59)
ssSeconds, padded (00 - 59)
Returns: Text
Example

prints 'red/blue/green'

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

Find

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

Finds a string of characters within a text value. Wildcards are NOT supported.

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

prints 6

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

Left

Left( value, charCount ) -> returns: Text

Returns the specified number of characters from the beginning of a text value.

Name Type Description
value Text | Array | Number | Boolean The text from which to get characters.
charCount Number The number of characters to get from the beginning of the text.
Returns: Text
Example

prints 'the'

Left('the quick brown fox', 3)

Lower

Lower( value ) -> returns: Text

Makes a text value lower case.

Name Type Description
value Text The text to be made lowercase.
Returns: Text
Example

prints 'hello'

Lower('HELLO')

Mid

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

Gets a number of characters from the middle of a text value.

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

prints 'quick'

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

Proper

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

Converts a text value 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 Text The text to convert to title case.
applyTo Text optional A text value 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: Text
Example

prints 'The Quick Brown Fox'

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

Replace

Replace( value, searchText, replacementText, allOccurrences? ) -> returns: Text

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

Name Type Description
value Text | Array | Number | Boolean The value in which to make replacements.
searchText Text The text to search for.
replacementText Text The replacement text.
allOccurrences Boolean optional Indicates if all occurrences of the searchText should be replaced in the text. Defaults to true.
Returns: Text
Example

prints 'the quick red fox'

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

Right( value, charCount ) -> returns: Text

Returns the specified number of characters from the end of a text value.

Name Type Description
value Text | Array | Number | Boolean The text from which to get characters.
charCount Number The number of characters to get from the end of the text value.
Returns: Text
Example

prints 'fox'

Right('the quick brown fox', 3)

Split

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

Splits a text value into an array.

Name Type Description
value Text The text value to be split.
separator Text The separator used to split the text.
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: Text[]
Example

returns '[red,green]'

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

Trim

Trim( value ) -> returns: Text

Removes spaces from the beginning or end of an input text value.

Name Type Description
value Text The text to be trimmed.
Returns: Text
Example

prints 'hello world'

Trim('   hello world')

Upper

Upper( value ) -> returns: Text

Makes text upper case.

Name Type Description
value Text The text value to be made uppercase.
Returns: Text
Example

prints 'HELLO'

Upper('Hello')


Feedback on this topic?