AINE: Accelerated Interactive Narrator Engine
  • Download
  • References
  • Games
  • Wiki
  • Facebook Twitter
  • Object

    • List

    • String

  • Name

    indexOf()

  • Examples

    Player: {
    list: [2,2,2,5,3,4,5]
    str: "abcdefg"

    Event: Game_Start {
    print(list.indexOf(5))
    // Output: 3

    print(list.indexOf(5,4))
    // Output: 6

    print(str.indexOf("ef"))
    // Output: 4
    }
    }
  • Description

    For a list this method returns the index value of the first occurrence of the string, number, boolean, or object given by searchElement.

    For a string this method returns the index value of the first occurrence of the substring given by searchElement.

    If a fromIndex has been given, the search will start from the given index.
  • Syntax

    • list.indexOf(searchElement)
    • list.indexOf(searchElement,fromIndex)
    • string.indexOf(searchElement)
    • string.indexOf(searchElement,fromIndex)

  • Contact
  • Terms of Use
  • GitHub
  • Drakkashi.com

The copyright of all images rendered by me goes to their respective owners.
© 2008 Daniel Svejstrup Christensen