Documentation
TebexDiscordYouTubeGitHub
  • Introduction
  • FIVEM FREE RESOURCES
    • BDSC
      • Guides
        • Core Setup
          • Installing BDSC
          • Configuring BDSC
        • Plugin Development
          • What is a Plugin?
          • Plugin Structure
          • Extending Player Objects
      • API
        • Functions
          • Player
          • Server
          • Client
          • Shared
        • Modules
          • Player Manager
          • Buckets
          • Plugins
        • UI Components
    • boii_utils
      • Installation
      • Configuration
      • Modules
      • API
        • Callbacks
        • Characters
        • Commands
        • Cooldowns
        • Debugging
        • Entities
        • Environment
        • Framework Bridge
        • Geometry
        • Items
        • Keys
        • Licences
        • Maths
        • Methods
        • Player
        • Requests
        • Strings
        • Tables
        • Timestamps
        • UI Bridges
        • Vehicles
        • Version
        • XP
        • UI Elements
  • FIVEM PAID RESOURCES
    • Page 2
Powered by GitBook
On this page
  • Accessing the Module
  • Shared
  • capitalize(str)
  • random_string(length)
  • split(str, delimiter)
  • trim(str)
  1. FIVEM FREE RESOURCES
  2. boii_utils
  3. API

Strings

Provides utility functions for common string operations including casing, trimming, splitting, and generating random strings.


Accessing the Module

local STRINGS <const> = exports.boii_utils:get("modules.strings")

Shared

capitalize(str)

Capitalizes the first letter of each word in the string.

Parameters

Name
Type
Description

str

string

The string to capitalize

Example

local result = STRINGS.capitalize("hello world") -- "Hello World"

random_string(length)

Generates a random alphanumeric string of a given length.

Parameters

Name
Type
Description

length

number

The desired length of the string

Example

local id = STRINGS.random_string(8) -- e.g., "aZ82xY0p"

split(str, delimiter)

Splits a string into parts using a given delimiter.

Parameters

Name
Type
Description

str

string

The string to split

delimiter

string

The delimiter to split on

Example

local parts = STRINGS.split("one,two,three", ",") -- parts = {"one", "two", "three"}

trim(str)

Trims whitespace from both ends of the string.

Parameters

Name
Type
Description

str

string

The string to trim

Example

local clean = STRINGS.trim("  hello world  ") -- "hello world"
PreviousRequestsNextTables

Last updated 2 months ago