cp.fn.string

String-related functional programming helpers.


API Overview

Functions - API calls offered directly by the extension

  • isEmpty
  • match

API Documentation

Functions

isEmpty

   
Signature cp.fn.string.isEmpty(str) -> boolean
Type Function
Description Checks if the string is empty.
Parameters
  • str - The string to check.
Returns
  • true if the string is empty, false otherwise.
Notes None
Examples None
Source src/extensions/cp/fn/string.lua line 7

match

   
Signature cp.fn.string.match(pattern) -> function(str) -> ...
Type Function
Description Creates a function that matches the given pattern. Any groups in the pattern will be returned as multiple values.
Parameters
  • pattern - The pattern to match.
Returns
  • A function that takes a string and returns the matches.
Notes None
Examples None
Source src/extensions/cp/fn/string.lua line 20