| Maptitude GISDK Help |
Search for the last occurrence of a substring within a string, ending the search at a designated position.
location = PositionTo(int end_pos, string big_string, string search_string)
| Argument | Contents |
|---|---|
| end_pos | The ending character position |
| big_string | The string to be searched |
| search_string | The string for which to search |
An integer indicating the position at which search_string starts in big_string, or zero if search_string is not found in big_string.
If end_pos is null or less than one, the search ends at the end of the string.
The search moves from end_pos to the beginning of the string.
As long as the start of search_string is before end_pos its position can still be found; see the third example.
pos = PositionTo(6,"ABCABCA","ABC") // returns 4
pos = PositionTo(,"ABCABCA","A") // returns 7
pos = PositionTo(4,"ABCABCA","CAB") // returns 3
pos = PositionTo(2,"ABCABCA","CAB") // returns 0
| Function | Summary |
|---|---|
| Left() | Returns the leftmost n characters of a string |
| Position() | Returns the position of a substring within a string |
| PositionFrom() | Search for the first occurrence of a substring within a string, starting the search at a designated position |
| Right() | Returns the rightmost n characters of a string |
| Substitute() | Replaces a matching substring with a new string. |
| SubstituteChars() | Returns the input string with all occurrences of the characters listed in the find string replaced with the characters in the replacement string |
| Substring() | Extracts a portion of a string |
| ©2025 Caliper Corporation | www.caliper.com |