October\Rain\Support\Str

Source: ~/vendor/october/rain/src/Support/Str.php

Extends:

  • Illuminate\Support\Str

String helper

Protected properties

There are no protected properties in the class.

Show inherited protected properties

Inherited protected properties

  • protected static array $snakeCache - defined in Illuminate\Support\Str. The cache of snake-cased words.
  • protected static array $camelCache - defined in Illuminate\Support\Str. The cache of camel-cased words.
  • protected static array $studlyCache - defined in Illuminate\Support\Str. The cache of studly-cased words.
  • protected static array $macros - defined in Illuminate\Support\Str. The registered string macros.

Public methods

public static void getClassId($name)

Generates a class ID from either an object or a string of the class name.

Parameters
  • $name

public static void getClassNamespace($name)

Returns a class namespace

Parameters
  • $name

public static int getPrecedingSymbols(string $string, string $symbol)

If $string begins with any number of consecutive symbols, returns the number, otherwise returns 0

Parameters
  • string $string
  • string $symbol

public static void normalizeClassName($name)

Removes the starting slash from a class namespace \

Parameters
  • $name

public static void normalizeEol($string)

Converts line breaks to a standard \r\n pattern.

Parameters
  • $string

public static string ordinal(integer $number)

Converts number to its ordinal English form.

This method converts 13 to 13th, 2 to 2nd ...

Parameters
  • integer $number - Number to get its ordinal value

Show inherited public methods

Inherited public methods

  • public mixed __call(string $method, array $parameters) - defined in Illuminate\Support\Str. Dynamically handle calls to the class.
  • public static mixed __callStatic(string $method, array $parameters) - defined in Illuminate\Support\Str. Dynamically handle calls to the class.
  • public static string after(string $subject, string $search) - defined in Illuminate\Support\Str. Return the remainder of a string after a given value.
  • public static string ascii(string $value, string $language='en') - defined in Illuminate\Support\Str. Transliterate a UTF-8 value to ASCII.
  • public static string before(string $subject, string $search) - defined in Illuminate\Support\Str. Get the portion of a string before a given value.
  • public static string camel(string $value) - defined in Illuminate\Support\Str. Convert a value to camel case.
  • public static bool contains(string $haystack, string|array $needles) - defined in Illuminate\Support\Str. Determine if a given string contains a given substring.
  • public static bool endsWith(string $haystack, string|array $needles) - defined in Illuminate\Support\Str. Determine if a given string ends with a given substring.
  • public static string finish(string $value, string $cap) - defined in Illuminate\Support\Str. Cap a string with a single instance of a given value.
  • public static bool hasMacro(string $name) - defined in Illuminate\Support\Str. Checks if macro is registered.
  • public static bool is(string|array $pattern, string $value) - defined in Illuminate\Support\Str. Determine if a given string matches a given pattern.
  • public static string kebab(string $value) - defined in Illuminate\Support\Str. Convert a string to kebab case.
  • public static int length(string $value, string $encoding=NULL) - defined in Illuminate\Support\Str. Return the length of the given string.
  • public static string limit(string $value, int $limit=100, string $end='...') - defined in Illuminate\Support\Str. Limit the number of characters in a string.
  • public static string lower(string $value) - defined in Illuminate\Support\Str. Convert the given string to lower-case.
  • public static void macro(string $name, object|callable $macro) - defined in Illuminate\Support\Str. Register a custom macro.
  • public static void mixin(object $mixin) - defined in Illuminate\Support\Str. Mix another object into the class.
  • public static array parseCallback(string $callback, string|null $default=NULL) - defined in Illuminate\Support\Str. Parse a Class@method style callback into class and method.
  • public static string plural(string $value, int $count=2) - defined in Illuminate\Support\Str. Get the plural form of an English word.
  • public static string random(int $length=16) - defined in Illuminate\Support\Str. Generate a more truly "random" alpha-numeric string.
  • public static string replaceArray(string $search, array $replace, string $subject) - defined in Illuminate\Support\Str. Replace a given value in the string sequentially with an array.
  • public static string replaceFirst(string $search, string $replace, string $subject) - defined in Illuminate\Support\Str. Replace the first occurrence of a given value in the string.
  • public static string replaceLast(string $search, string $replace, string $subject) - defined in Illuminate\Support\Str. Replace the last occurrence of a given value in the string.
  • public static string singular(string $value) - defined in Illuminate\Support\Str. Get the singular form of an English word.
  • public static string slug(string $title, string $separator='-', string $language='en') - defined in Illuminate\Support\Str. Generate a URL friendly "slug" from a given string.
  • public static string snake(string $value, string $delimiter='_') - defined in Illuminate\Support\Str. Convert a string to snake case.
  • public static string start(string $value, string $prefix) - defined in Illuminate\Support\Str. Begin a string with a single instance of a given value.
  • public static bool startsWith(string $haystack, string|array $needles) - defined in Illuminate\Support\Str. Determine if a given string starts with a given substring.
  • public static string studly(string $value) - defined in Illuminate\Support\Str. Convert a value to studly caps case.
  • public static string substr(string $string, int $start, int|null $length=NULL) - defined in Illuminate\Support\Str. Returns the portion of string specified by the start and length parameters.
  • public static string title(string $value) - defined in Illuminate\Support\Str. Convert the given string to title case.
  • public static string ucfirst(string $string) - defined in Illuminate\Support\Str. Make a string's first character uppercase.
  • public static string upper(string $value) - defined in Illuminate\Support\Str. Convert the given string to upper-case.
  • public static string words(string $value, int $words=100, string $end='...') - defined in Illuminate\Support\Str. Limit the number of words in a string.

Protected methods

Show inherited protected methods

Inherited protected methods

  • protected static array charsArray() - defined in Illuminate\Support\Str. Returns the replacements for the ascii method.
  • protected static array|null languageSpecificCharsArray(string $language) - defined in Illuminate\Support\Str. Returns the language specific replacements for the ascii method.