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

    String

  • Examples

    Player:
    {
    colour: "Red"
    head: "riding hood"

    Event: Game_Start {
    print(head.charAt(0).toUpperCase() + head.substr(1))
    // Output: Riding hood

    print("The colour is " + colour.toLowerCase())
    // Output: The colour is red
    }
    }
  • Description

    A string is a sequence of characters. The String data type is declared using the string operators " and '. The text between two identical string operators is recognized as being a sequence of characters opposed to actual code.

    You can access properties and methods of a string after it has been written to an object property. These methods are useful for manipulating the text stored in the string.
  • Syntax

    • "text"
    • 'text'
  • Methods

    • charAt()

      Returns the character at the given index
    • indexOf()

      Returns the index value of the first occurrence of the given substring
    • replace()

      Returns a string where any occurrence of a given pattern is replaced by a given substring
    • split()

      Splits the string into a list of substrings by dividing it at every occurrence of a given pattern
    • substr()

      Returns a substring between two given index values
    • substring()

      Returns a substring between two given index values
    • toLowerCase()

      Converts all characters to lower case
    • toUpperCase()

      Converts all characters to upper case
  • Properties

    • length

      [read-only] Holds the number of characters in the String

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

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