-
Notifications
You must be signed in to change notification settings - Fork 15
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>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.
result = strSubstring("smiles", 1, 5);
// result will be "mile"| 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) |
A function that returns first N characters of a string.
result = strFirstN("abcdef", 2);
// result will be "ab"| Parameter | Type | Description |
|---|---|---|
| text | string | the text to operate on |
| n | integer | number of characters |
A function that returns last N characters of a string.
result = strLastN("BANKNIFTY2010932400PE", 2);
// result will be "PE"| Parameter | Type | Description |
|---|---|---|
| text | string | the text to operate on |
| n | integer | number of characters |