Modules
Filter
Shared

Shared

Filters out a string from a string.

lib.filter

lib.filter(string, ...)

Parameters

  • string: The string to filter.
  • ...: The filters to apply.

Returns

  • string: The filtered string.

Example

local string = lib.filter("Hello World Lenix World", "World", "Lenix")
print(string)
  • Output: Hello ~~World~~ ~~Lenix~~ World
local string = lib.filter("Hello World Lenix World", {"World", 1})
print(string)
  • Output: Hello ~~World~~ Lenix World
local string = lib.filter("Hello World Lenix World", {"World", 2}, "Lenix")
print(string)
  • Output: Hello World ~~Lenix~~ ~~World~~