StringRight (FPScript)

21.09.2021

Pulls a substring out of a string starting from the right.

Syntax

StringRight(String, Length)

 

The syntax of the StringRight function consists of the following parts:

Part

Description

String

String from which a substring is to be taken.

Permitted data structures are scalar value, data series und data matrix. Supported data types are string.

Length

The length of the substring.

Permitted data structures are scalar value, data series und data matrix. All integral data types are permitted.

Remarks

The data type of the result is always string.

The structure of the result corresponds to that of the argument String.

If the length specified exceeds the length of the string, the complete string is passed. If the length is less than or equal to zero, an empty string is passed.

If the String argument is a data series or data matrix, the calculation is performed on a per-element basis and the result is either a data series or a data matrix. If the Length argument is a data series or data matrix, then the Length must match the String argument in the number of rows and, if applicable, number of columns.

If an argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

StringRight("This is an example", 7)

Returns the substring "example".

StringRight({"2016-04-22", "2016-04-19", "2016-04-28"}, 5)

Results in the data series {"04-22", "04-19", "04-28"}.

See Also

StringLeft Function

StringMid Function

StringFind Function

StringReverseFind Function

StringConcat Function

Share article or send as email:

You might be interested in these articles