<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Use the Okta Expression Language for String Manipulation
Single Sign-On
Overview
This article explains the functionality behind manipulating strings using the Okta Expression Language.
Applies To
  • Okta Classic Engine
  • Okta Identity Engine
Solution
Please check the video below for how to manipulate strings using the Okta Expression Language.

Cases

Function

Input parameter signature

Return type

example

Output

String.append

(String str, String suffix)

String

String.append("This is", " a test")

This is a test

String.join

(String separator, String... strings)

String

String.join(",", "This", "is", "a", "test")

This,is,a,test

 

 

 

String.join("", "This", "is", "a", "test")

Thisisatest

String.len

(String input)

Integer

String.len("This")

4

String.removeSpaces

(String input)

String

String.removeSpaces("This is a test")

Thisisatest

String.replace

(String input, match, replacement)

String

String.replace("This is a test", "is", "at")

That at a test

String.replaceFirst

(String input, match, replacement)

String

String.replaceFirst("This is a test", "is", "at")

That is a test

String.stringContains

(String input, String searchString)

Boolean

String.stringContains("This is a test", "test")

true

 

 

 

String.stringContains("This is a test", "doesn'tExist")

false

String.stringSwitch

(String input, String defaultString, String... keyValuePairs)

String

String.stringSwitch("This is a test", "default", "key1", "value1")

default

 

 

 

String.stringSwitch("This is a test", "default", "test", "value1")

value1

 

 

 

String.stringSwitch("First match wins", "default", "absent", "value1", "wins", "value2", "match", "value3")

value2

 

 

 

String.stringSwitch("Substrings count", "default", "ring", "value1")

value1

String.substring

(String input, int startIndex, int endIndex)

String

String.substring("This is a test", 2, 9)

is is a

String.substringAfter

(String input, String searchString)

String

String.substringAfter("abc@okta.com", "@")

okta.com

String.substringBefore

(String input, String searchString)

String

String.substringBefore("abc@okta.com", "@")

abc

String.toUpperCase

(String input)

String

String.toUpperCase("This")

THIS

String.toLowerCase

(String input)

String

String.toLowerCase("ThiS")

this

 

Related References


 
Loading
Use the Okta Expression Language for String Manipulation