User Manual

GETTING STARTED


OTHER EDITIONS


LAUNCHERS


MODULES


PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support

ALL USER MANUAL VERSIONS

Ignition 8.1. Offline Version (04/2021)
Ignition 8 Online Version
Ignition 7.9 Online Version
Ignition 7.8 Online Version

Deprecated Pages

SDK Documentation

Employees

Sign In

Skip to end of metadata
Go to start of metadata

This function is used by Ignition's Expression language.

Description

Searches for the last occurrence of the substring inside of string. Returns the index of where substring was found, or -1 if it wasn't found. The first position in the string is position 0.

Syntax

lastIndexOf(string, substring)

  • Parameters

String, Tuple, or List object - The object to search through.

This feature was changed in Ignition version 8.1.8:
The string parameter now accepts tuples and lists. 

String substring - The string to search for.

  • Results

String - The index where the substring was last found in the string.

Examples
Code Snippet
lastIndexOf("Hamburger", "urge") //Returns 4.
Code Snippet
lastIndexOf("Test", "") //Returns 4.
Code Snippet
lastIndexOf("Dysfunctional", "fun") //Returns 3.
Code Snippet
lastIndexOf("Dysfunctional", "marble") //Returns -1.
Code Snippet
lastIndexOf("banana", "n") //Returns 4.
  • No labels