Table

Noir.Libraries.Table: NoirLibrary

A library containing helper methods relating to tables.


Noir.Libraries.Table:Length(tbl)

Returns the length of the provided table.

Parameters

  • tbl: table

Returns

  • integer


Noir.Libraries.Table:Random(tbl)

Returns a random value in the provided table.

Parameters

  • tbl: table

Returns

  • any


Return the keys of the provided table.

Parameters

  • tbl: table

Returns

  • tbl


Return the values of the provided table.

Parameters

  • tbl: tbl

Returns

  • tbl


Get a portion of a table between two points.

Parameters

  • tbl: tbl

  • start: number|nil

  • finish: number|nil

Returns

  • tbl


Converts a table to a string by iterating deep through the table.

Parameters

  • tbl: table

  • indent: integer|nil

Returns

  • string


Copy a table (shallow).

Parameters

  • tbl: tbl

Returns

  • tbl


Copy a table (deep).

Parameters

  • tbl: tbl

Returns

  • tbl


Merge two tables together (unforced).

Parameters

  • tbl: table

  • other: table

Returns

  • table


Merge two tables together (forced).

Parameters

  • tbl: table

  • other: table

Returns

  • table


Find a value in a table. Returns the index, or nil if not found.

Parameters

  • tbl: table

  • value: any

Returns

  • any|nil


Find a value in a table. Unlike :Find(), this method will recursively search through nested tables to find the value.

Parameters

  • tbl: table

  • value: any

Returns

  • any|nil,: table|nil

Last updated