Skip to content

Text Functions

Pritesh Mhatre edited this page Jan 7, 2020 · 4 revisions

Utility functions that work on text data. These functions are available in text-util.afl. To use these functions, add following line at the top of your afl:

#include <text-util.afl>

Functions

strSubstring

AmiBroker substring function. Returns a string that is a substring of the text. Implementation of Java substring function in AmiBroker. For more details see javadoc.

Example

result = strSubstring("smiles", 1, 5);
// result will be "mile"

Parameters

Parameter Type Description
text string the text to operate on
beginIndex integer the beginning index (inclusive), index of first character is zero
endIndex integer the ending index (exclusive)

strFirstN

A function that returns first N characters of a string.

Example

result = strFirstN("abcdef", 2);
// result will be "ab"

Parameters

Parameter Type Description
text string the text to operate on
n integer number of characters

strLastN

A function that returns last N characters of a string.

Example

result = strLastN("BANKNIFTY2010932400PE", 2);
// result will be "PE"

Parameters

Parameter Type Description
text string the text to operate on
n integer number of characters

Clone this wiki locally