subStr Function [AX 2012]

Updated: December 10, 2009

Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Retrieves part of a string.


str subStr(str _text, int _position, int _number)

Parameter

Description

_text

The original string.

_position

The position in the original string where the part to retrieve begins.

_number

A signed integer that indicates the direction and number of positions to retrieve from the original string.

If there is a minus sign preceding _number, the system selects the substring backward from the specified position.

A substring of the original string.

If there is a minus sign before the value of the _number parameter, the substring will be selected backward from the specified position.

  • subStr("ABCDEFGHIJ",3,5); //Returns the string “CDEFG”.

  • subStr("ABCDEFGHIJ",7,-4); //Returns the string “DEFG”.

  • subStr("abcdef"),2,99) //Returns the string "cdef".

  • subStr("abcdef",2,3) //Returns the string "bcd".

  • subStr("abcdef",2,-3); //Returns the string "ab".


Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).

Community Additions

ADD
Show: