class Strings (View source)

The GenericDatabase\Helpers\Types\Scalars\Strings class provides methods for manipulating strings.

Methods

static string
toCamelize(string $input, string $separator = '_')

Converts a string to camelCase.

static string
strRpeat(int $num, string $string)

Repeat a given string a specified number of times.

Details

static string toCamelize(string $input, string $separator = '_')

Converts a string to camelCase.

This method takes an input string and converts it to camelCase format. By default, it uses an underscore ('_') as the word separator.

Parameters

string $input

The input string to be converted.

string $separator

The separator used to split words in the input string. Default is '_'.

Return Value

string

The camelCase formatted string.

static string strRpeat(int $num, string $string)

Repeat a given string a specified number of times.

This method takes a number and a string and returns a new string with the given string repeated the specified number of times.

Parameters

int $num

The number of times to repeat the string.

string $string

The string to be repeated.

Return Value

string

The repeated string.