> Source: https://docs.cyberelements.io/identity/7.1/UserDocumentation/AutomaticProvisioningConnectorsManagement/KeywordsInOperations/CharacterStrings/

# Character strings

## UPPER

Converts a text string to uppercase.

**Function syntax:**

<UPPER:[Expression]>

**Use mode:**

- The keyword UPPER can be used in all fields of type “expression” such as operations of type COPY, MODVALUE, etc.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## LOWER

Converts a text string to lowercase.

**Function syntax:**

<LOWER:[Expression]>

**Use mode:**

- The keyword LOWER can be used in all fields of type “expression” such as operations of type COPY, MODVALUE, etc.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## LEFT

**Function syntax:**

<LEFT:[Character_number]:[Expression]>

**Use mode:**

- The keyword LEFT can be used in all fields of type “expression” such as operations of type COPY, MODVALUE, etc.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## TOKLEFT

Retrieves the nth object counted from the left.

**Function syntax:**

<TOKLEFT:[separator]:[Object_number]:[Expression]>

An object is enclosed between two separators. It is not necessary to place a separator at the beginning and end of the expression string.

**Use mode:**

- The keyword TOKLEFT can be used in all fields of type “expression” such as operations of type COPY, MODVALUE, etc.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

**Examples of configuration:**

- Example:
    - <TOKLEFT:/:3:Level 1/Level 2/Level 3/Level 4/ Level 5>
    - Result returned: Level 3

## RIGHT

Retrieves a number of characters from the right of a value.

**Function syntax:**

<RIGHT:[Character_number]:[Expression]>

**Use mode:**

- The keyword RIGHT can be used in all fields of type “expression” such as operations of type COPY, MODVALUE, etc.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## SHA256

Encrypts a character string in SHA256.

**Function syntax:**

<SHA256:[string_encoding]:[Hex_B64]:[Expression]>

With:

- [string_encoding]: “UTF8” or “UTF16”. Encoding to be specified according to the format expected by the target application. UTF8 should be used in most cases.
- [Hex_B64]: “HEX” or “B64” to choose the string format. HEX for hexadecimal, B64 for base 64.

**Use mode:**

- The SHA256 keyword can be used in all “expression” type fields such as COPY, MODVALUE, etc. operations.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## TOKRIGHT

Retrieves part of a character string from the nth object counted from the right.

**Function syntax:**

<TOKRIGHT:[separator]:[Object_number]:[Expression]>

An object is enclosed between two separators. It is not necessary to place a separator at the beginning and end of the expression string.

**Use mode:**

- The keyword TOKRIGHT can be used in all fields of type “expression” such as COPY, MODVALUE, etc.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

**Examples of configuration:**

- Example:
    - <TOKLEFT:/:2:Level 1/Level 2/Level 3/Level 4/ Level 5>
    - Result returned: Level 4/ Level 5

## CENTER

Retrieves the characters in the middle by deleting a number of characters on the left and right.

**Function syntax:**

<CENTER:[Number_of_characters_to_the_left_to_delete]:[Number_of_characters_to_the_right_to_delete]:[Expression]>

**Use mode:**

- The keyword CENTER can be used in all fields of type “expression” such as operations of type COPY, MODVALUE, etc.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## REWRITEURL

Rewriting a URL.

**Function syntax:**

<REWRITEURL:[url]>

**Use mode:**

- The REWRITEURL keyword can be used in all fields of type “expression” such as COPY, MODVALUE, etc.

**Examples of configuration:**

- Example:
    - <REWRITEURL:http%3F%3A%3Awww.avencis.net>
    - Result returned: http://www.avencis.net

## GEN_PASSWORD

Generation of a password based on a mask and with support for special characters defined in the settings.

**Function syntax:**

<GEN_PASSWORD:[pwd_format]:[special_characters]>

The password format must be defined with the following elements:

- U An upper case letter
- L A lower case letter
- A An upper or lower case letter
- N A number
- S A special character from the [special_characters] list
- X All characters (U+L+N+S)

**Use mode:**

- The GEN_PASSWORD keyword can be used in all fields of type “expression” such as COPY, MODVALUE, etc. operations.

**Examples of configuration:**

- Example:
    - <GEN_PASSWORD:ULNXXXXXXX:,$£!§&#>

## B64ENCODEASCII

Converts an expression to ASCII and then returns the string encoded in B64.

**Function syntax:**

<B64ENCODEASCII:[Expression]>

**Use mode:**

- The B64ENCODEASCII keyword can be used in all “expression” type fields such as COPY, MODVALUE, etc. operations.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## B64SID2STRING

Converts a SID to Base64 and returns the string in Unicode format.

**Function syntax:**

<B64SID2STRING:[Expression]>

**Use mode:**

- The B64SID2STRING keyword can be used in all “expression” type fields such as COPY, MODVALUE, etc. operations.
- The evaluated expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

## FIND

Function for finding the position of a character string within another character string. It returns the index of the position (starting at index 0) if the string is found, otherwise it returns the length of the string.

**Function syntax:**

<FIND:[chaîne_recherchée]:[chaîne_initiale]:[index_de_départ]>

The index starts at position 0.

**Use mode:**

- The FIND operation can be used in all “expression” type fields, such as COPY, MODVALUE, etc.
- The different strings used in the expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

**Examples of configuration:**

- Example 1:
    - <FIND:E:<SyncAttSrc:FIRSTNAME>:0> with <SyncAttSrc:FIRSTNAME> = Emilie
    - Result = 0
- Example 2:
    - <FIND:I:<SyncAttSrc:FIRSTNAME>:0> with <SyncAttSrc:FIRSTNAME> = Emilie
    - Result = 2
- Example 3:
    - <FIND:E:<SyncAttSrc:FIRSTNAME>:0> with <SyncAttSrc:FIRSTNAME> = Paul
    - Result = 4

## SUBSTRING

Function that extracts a character string from another character string. It returns the character string if the parameters passed are valid; otherwise, it returns empty. **Function syntax:**

<SUBSTRING:[chaîne_initiale]:[index_début]:[longueur_chaîne]>

The index starts at position 0.

**Use mode:**

- The SUBSTRING operation can be used in all fields of type “expression” such as COPY, MODVALUE, etc.
- The different strings used in the expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

**Examples of configuration:**

- Example 1:
    - <SUBSTRING:<SyncAttSrc:DisplayName>:0:<FIND: :<SyncAttSrc:DisplayName>:0>> with <SyncAttSrc:DisplayName> = Carine HOPFNER
    - Result = Carine

## LEN

Function that returns the length of a character string. The function returns 0 if there is an error in the configuration.

**Function syntax:**

<LEN:[chaîne_initiale]>

**Use mode:**

- The LEN operation can be used in all fields of type “expression,” such as COPY, MODVALUE, etc.
- The different strings used in the expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

**Examples of configuration:**

- Example 1:
    - <LEN:<SyncAttSrc:DisplayName>> with <SyncAttSrc:DisplayName> = Emilie Paris
    - Result = 12

## REPLACE

Available from version 7.0 onwards. Function that replaces the character string “string_to_replace” in a given string “initial_string” with the string “destination_string”. Returns the modified character string. The function is case sensitive.

**Function syntax:**

<REPLACE:[initial_string]:[string_to_replace]:[destination_string]:[Boolean_all_or_first]>

Boolean_all_or_first: can take the values 0 or 1. If 0, then only the first occurrence found is replaced; if 1, then all occurrences found are replaced. The parameter is optional; the default value is 0.

Destination_string can be empty: in this case, the string to be replaced is simply deleted.

**Use mode:**

- The REPLACE operation can be used in all fields of type “expression”, such as COPY, MODVALUE, etc.
- The different strings used in the expression can contain keywords to retrieve attribute values, for example SyncAttSrc or SyncAttDst.

**Examples of configuration:**

- <REPLACE:XXXstringXXX:string:newString> returns XXXnewStringXXX
- <REPLACE:XXXstringXXX:X::0> returns XXstringXXX
- <REPLACE:XXXstringXXX:X::1> returns string
- <REPLACE:XXXstringXXX:X:A:1> returns AAAstringAAA
