FunctionCopy link to clipboard
searchb( search_text, within_text, start_num )
Searches the text for a particular substring, returning the positional index of the first byte of the first match.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Text |
The text that will be searched for. |
|
Text |
The text to be searched. |
|
Number |
The index of the within_text value from which to start searching. 1 by default. |
ReturnsCopy link to clipboard
Number
Usage considerationsCopy link to clipboard
Using the search_text parameterCopy link to clipboard
The search_text parameter supports ?
as a wildcard character.
Using the within_text parameterCopy link to clipboard
The first byte of the entire within_text value has an index of 1.
ExamplesCopy link to clipboard
Searching for a substring within a stringCopy link to clipboard
1
searchb("to", "boston")
Copy
Returns 4
.
Searching a string with multiple bytes per characterCopy link to clipboard
1
searchb("tt", "café latte")
Copy
Returns 9
. The "é" character counts as 2 bytes.
Searching with a start indexCopy link to clipboard
1
searchb("o", "boston", 4)
Copy
Returns 5
. The function starts searching the string at byte index 4.
ListsCopy link to clipboard
Searching multiple strings at onceCopy link to clipboard
1
searchb({ "t", "i" }, { "boston", "paris" })
Copy
Returns { 4, 4 }
.
Searching with multiple start indicesCopy link to clipboard
1
searchb("o", "boston", { 1, 3 })
Copy
Returns { 2, 5 }
. The search is repeated at each start index in the list.
Searching multiple strings with wildcardsCopy link to clipboard
1
searchb("s??n", { "boston", "paris" })
Copy
Returns { 3, 0 }
.
Edge casesCopy link to clipboard
Empty list parametersCopy link to clipboard
1
searchb({}, "boston")
Copy
Returns {}
.
Empty string start_numCopy link to clipboard
1
searchb("o", "boston", "")
Copy
Returns 0
. The function always returns 0 when given an empty string start_num.
Feature compatibilityCopy link to clipboard
The table below lists this function's compatibility with various features in Appian.
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Compatible | |
Process Events | Compatible | |
Process Autoscaling | Compatible |